diff --git a/src/main/java/org/asamk/signal/manager/Manager.java b/src/main/java/org/asamk/signal/manager/Manager.java index 81f870cd..f2a26480 100644 --- a/src/main/java/org/asamk/signal/manager/Manager.java +++ b/src/main/java/org/asamk/signal/manager/Manager.java @@ -759,13 +759,16 @@ public class Manager implements Closeable { * Change the expiration timer for a contact */ public void setExpirationTimer(SignalServiceAddress address, int messageExpirationTimer) throws IOException { - final SignalServiceDataMessage.Builder messageBuilder = SignalServiceDataMessage.newBuilder(); ContactInfo contact = account.getContactStore().getContact(address); contact.messageExpirationTime = messageExpirationTimer; account.getContactStore().updateContact(contact); + sendExpirationTimerUpdate(address); account.save(); - messageBuilder.withExpiration(messageExpirationTimer); - messageBuilder.asExpirationUpdate(); + } + + private void sendExpirationTimerUpdate(SignalServiceAddress address) throws IOException { + final SignalServiceDataMessage.Builder messageBuilder = SignalServiceDataMessage.newBuilder() + .asExpirationUpdate(); sendMessage(messageBuilder, Collections.singleton(address)); }