From b39a7ac939b8e41170adfaaddfff8671dfa4531f Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Fri, 22 Jun 2018 11:29:16 -0700 Subject: [PATCH] Add expiration time to group update requests. --- src/org/thoughtcrime/securesms/jobs/PushGroupUpdateJob.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/thoughtcrime/securesms/jobs/PushGroupUpdateJob.java b/src/org/thoughtcrime/securesms/jobs/PushGroupUpdateJob.java index 4e258d5018..a197baf1a1 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushGroupUpdateJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushGroupUpdateJob.java @@ -11,6 +11,7 @@ import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord; import org.thoughtcrime.securesms.dependencies.InjectableType; import org.thoughtcrime.securesms.jobmanager.JobParameters; import org.thoughtcrime.securesms.jobmanager.requirements.NetworkRequirement; +import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.util.GroupUtil; import org.whispersystems.libsignal.util.guava.Optional; import org.whispersystems.signalservice.api.SignalServiceMessageSender; @@ -88,9 +89,13 @@ public class PushGroupUpdateJob extends ContextJob implements InjectableType { .withName(record.get().getTitle()) .build(); + Address groupAddress = Address.fromSerialized(GroupUtil.getEncodedId(groupId, false)); + Recipient groupRecipient = Recipient.from(context, groupAddress, false); + SignalServiceDataMessage message = SignalServiceDataMessage.newBuilder() .asGroupMessage(groupContext) .withTimestamp(System.currentTimeMillis()) + .withExpiration(groupRecipient.getExpireMessages()) .build(); messageSender.sendMessage(new SignalServiceAddress(source), message);