implement Dbus setExpirationTimer (#735)

implement method

update documentation
This commit is contained in:
John Freed 2021-09-26 09:04:40 +02:00 committed by GitHub
parent 8bee08fd96
commit d47574351e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View file

@ -61,6 +61,13 @@ updateProfile(newName<s>, about <s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>
Exceptions: Failure Exceptions: Failure
setExpirationTimer(number<s>, expiration<i>) -> <>::
* number : Phone number of recipient
* expiration : int32 for the number of seconds before messages to this recipient disappear. Set to 0 to disable expiration.
Exceptions: Failure
setContactBlocked(number<s>, block<b>) -> <>:: setContactBlocked(number<s>, block<b>) -> <>::
* number : Phone number affected by method * number : Phone number affected by method
* block : 0=remove block , 1=blocked * block : 0=remove block , 1=blocked

View file

@ -71,6 +71,8 @@ public interface Signal extends DBusInterface {
void setContactName(String number, String name) throws Error.InvalidNumber; void setContactName(String number, String name) throws Error.InvalidNumber;
void setExpirationTimer(final String number, final int expiration) throws Error.Failure;
void setContactBlocked(String number, boolean blocked) throws Error.InvalidNumber; void setContactBlocked(String number, boolean blocked) throws Error.InvalidNumber;
void setGroupBlocked(byte[] groupId, boolean blocked) throws Error.GroupNotFound, Error.InvalidGroupId; void setGroupBlocked(byte[] groupId, boolean blocked) throws Error.GroupNotFound, Error.InvalidGroupId;

View file

@ -305,6 +305,15 @@ public class DbusSignalImpl implements Signal {
} }
} }
@Override
public void setExpirationTimer(final String number, final int expiration) {
try {
m.setExpirationTimer(getSingleRecipientIdentifier(number, m.getUsername()), expiration);
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
}
}
@Override @Override
public void setContactBlocked(final String number, final boolean blocked) { public void setContactBlocked(final String number, final boolean blocked) {
try { try {