mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 07:53:38 +00:00
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:
parent
20cc6f4d0e
commit
b5d4cac90a
@ -380,9 +380,14 @@ public class PushDecryptJob extends ContextJob {
|
|||||||
private void handleGroupMessage(@NonNull SignalServiceEnvelope envelope,
|
private void handleGroupMessage(@NonNull SignalServiceEnvelope envelope,
|
||||||
@NonNull SignalServiceDataMessage message,
|
@NonNull SignalServiceDataMessage message,
|
||||||
@NonNull Optional<Long> smsMessageId)
|
@NonNull Optional<Long> smsMessageId)
|
||||||
|
throws MmsException
|
||||||
{
|
{
|
||||||
GroupMessageProcessor.process(context, envelope, message, false);
|
GroupMessageProcessor.process(context, envelope, message, false);
|
||||||
|
|
||||||
|
if (message.getExpiresInSeconds() != 0 && message.getExpiresInSeconds() != getMessageDestination(envelope, message).getExpireMessages()) {
|
||||||
|
handleExpirationUpdate(envelope, message, Optional.absent());
|
||||||
|
}
|
||||||
|
|
||||||
if (smsMessageId.isPresent()) {
|
if (smsMessageId.isPresent()) {
|
||||||
DatabaseFactory.getSmsDatabase(context).deleteMessage(smsMessageId.get());
|
DatabaseFactory.getSmsDatabase(context).deleteMessage(smsMessageId.get());
|
||||||
}
|
}
|
||||||
|
@ -168,6 +168,7 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType {
|
|||||||
SignalServiceGroup group = new SignalServiceGroup(type, GroupUtil.getDecodedId(groupId), groupContext.getName(), groupContext.getMembersList(), avatar);
|
SignalServiceGroup group = new SignalServiceGroup(type, GroupUtil.getDecodedId(groupId), groupContext.getName(), groupContext.getMembersList(), avatar);
|
||||||
SignalServiceDataMessage groupDataMessage = SignalServiceDataMessage.newBuilder()
|
SignalServiceDataMessage groupDataMessage = SignalServiceDataMessage.newBuilder()
|
||||||
.withTimestamp(message.getSentTimeMillis())
|
.withTimestamp(message.getSentTimeMillis())
|
||||||
|
.withExpiration(message.getRecipient().getExpireMessages())
|
||||||
.asGroupMessage(group)
|
.asGroupMessage(group)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user