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.
This commit is contained in:
Greyson Parrelli 2018-06-21 08:13:10 -07:00
parent 20cc6f4d0e
commit b5d4cac90a
2 changed files with 6 additions and 0 deletions

View File

@ -380,9 +380,14 @@ public class PushDecryptJob extends ContextJob {
private void handleGroupMessage(@NonNull SignalServiceEnvelope envelope,
@NonNull SignalServiceDataMessage message,
@NonNull Optional<Long> 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());
}

View File

@ -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();