From b5d4cac90a27103bbc40cd8db0555908745f4517 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Thu, 21 Jun 2018 08:13:10 -0700 Subject: [PATCH] Send/receive expiration times for group updates. This particularly helps with the bug where people who were newly added to a group wouldn't receive an expiration timer until the first message was sent. --- src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java | 5 +++++ src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java | 1 + 2 files changed, 6 insertions(+) diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index 3ecc56176d..e433cdf6e5 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -380,9 +380,14 @@ public class PushDecryptJob extends ContextJob { private void handleGroupMessage(@NonNull SignalServiceEnvelope envelope, @NonNull SignalServiceDataMessage message, @NonNull Optional smsMessageId) + throws MmsException { GroupMessageProcessor.process(context, envelope, message, false); + if (message.getExpiresInSeconds() != 0 && message.getExpiresInSeconds() != getMessageDestination(envelope, message).getExpireMessages()) { + handleExpirationUpdate(envelope, message, Optional.absent()); + } + if (smsMessageId.isPresent()) { DatabaseFactory.getSmsDatabase(context).deleteMessage(smsMessageId.get()); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java index af31833c79..6f1f824f45 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java @@ -168,6 +168,7 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType { SignalServiceGroup group = new SignalServiceGroup(type, GroupUtil.getDecodedId(groupId), groupContext.getName(), groupContext.getMembersList(), avatar); SignalServiceDataMessage groupDataMessage = SignalServiceDataMessage.newBuilder() .withTimestamp(message.getSentTimeMillis()) + .withExpiration(message.getRecipient().getExpireMessages()) .asGroupMessage(group) .build();