mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
Add expiration time to group update requests.
This commit is contained in:
parent
b5d4cac90a
commit
b39a7ac939
@ -11,6 +11,7 @@ import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord;
|
|||||||
import org.thoughtcrime.securesms.dependencies.InjectableType;
|
import org.thoughtcrime.securesms.dependencies.InjectableType;
|
||||||
import org.thoughtcrime.securesms.jobmanager.JobParameters;
|
import org.thoughtcrime.securesms.jobmanager.JobParameters;
|
||||||
import org.thoughtcrime.securesms.jobmanager.requirements.NetworkRequirement;
|
import org.thoughtcrime.securesms.jobmanager.requirements.NetworkRequirement;
|
||||||
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.util.GroupUtil;
|
import org.thoughtcrime.securesms.util.GroupUtil;
|
||||||
import org.whispersystems.libsignal.util.guava.Optional;
|
import org.whispersystems.libsignal.util.guava.Optional;
|
||||||
import org.whispersystems.signalservice.api.SignalServiceMessageSender;
|
import org.whispersystems.signalservice.api.SignalServiceMessageSender;
|
||||||
@ -88,9 +89,13 @@ public class PushGroupUpdateJob extends ContextJob implements InjectableType {
|
|||||||
.withName(record.get().getTitle())
|
.withName(record.get().getTitle())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Address groupAddress = Address.fromSerialized(GroupUtil.getEncodedId(groupId, false));
|
||||||
|
Recipient groupRecipient = Recipient.from(context, groupAddress, false);
|
||||||
|
|
||||||
SignalServiceDataMessage message = SignalServiceDataMessage.newBuilder()
|
SignalServiceDataMessage message = SignalServiceDataMessage.newBuilder()
|
||||||
.asGroupMessage(groupContext)
|
.asGroupMessage(groupContext)
|
||||||
.withTimestamp(System.currentTimeMillis())
|
.withTimestamp(System.currentTimeMillis())
|
||||||
|
.withExpiration(groupRecipient.getExpireMessages())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
messageSender.sendMessage(new SignalServiceAddress(source), message);
|
messageSender.sendMessage(new SignalServiceAddress(source), message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user