Update expiration type proto

This commit is contained in:
charles 2022-11-23 11:20:30 +11:00
parent fa1a2f5a9d
commit 11bf0a06a8
4 changed files with 21 additions and 19 deletions

View File

@ -8,7 +8,7 @@ import org.session.libsession.messaging.utilities.Data
import org.session.libsession.snode.SnodeAPI import org.session.libsession.snode.SnodeAPI
import org.session.libsession.utilities.Address import org.session.libsession.utilities.Address
class DisappearingMessagesJob(val messageIds: LongArray, val startedAtMs: Long): Job { class DisappearingMessagesJob(val messageIds: LongArray = longArrayOf(), val startedAtMs: Long = 0): Job {
override var delegate: JobDelegate? = null override var delegate: JobDelegate? = null
override var id: String? = null override var id: String? = null

View File

@ -4,6 +4,7 @@ import android.text.TextUtils
import org.session.libsession.avatars.AvatarHelper import org.session.libsession.avatars.AvatarHelper
import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.MessagingModuleConfiguration
import org.session.libsession.messaging.jobs.BackgroundGroupAddJob import org.session.libsession.messaging.jobs.BackgroundGroupAddJob
import org.session.libsession.messaging.jobs.DisappearingMessagesJob
import org.session.libsession.messaging.jobs.JobQueue import org.session.libsession.messaging.jobs.JobQueue
import org.session.libsession.messaging.messages.ExpirationConfiguration import org.session.libsession.messaging.messages.ExpirationConfiguration
import org.session.libsession.messaging.messages.Message import org.session.libsession.messaging.messages.Message
@ -78,6 +79,7 @@ fun MessageReceiver.handle(message: Message, proto: SignalServiceProtos.Content,
is CallMessage -> handleCallMessage(message) is CallMessage -> handleCallMessage(message)
is SyncedExpiriesMessage -> handleSyncedExpiriesMessage(message) is SyncedExpiriesMessage -> handleSyncedExpiriesMessage(message)
} }
JobQueue.shared.add(DisappearingMessagesJob())
} }
fun updateExpirationConfigurationIfNeeded(message: Message, proto: SignalServiceProtos.Content, openGroupID: String?) { fun updateExpirationConfigurationIfNeeded(message: Message, proto: SignalServiceProtos.Content, openGroupID: String?) {

View File

@ -44,8 +44,8 @@ message UnsendRequest {
message Content { message Content {
enum ExpirationType { enum ExpirationType {
DELETE_AFTER_SEND = 1; DELETE_AFTER_READ = 1;
DELETE_AFTER_READ = 2; DELETE_AFTER_SEND = 2;
} }
optional DataMessage dataMessage = 1; optional DataMessage dataMessage = 1;

View File

@ -2747,31 +2747,31 @@ public final class SignalServiceProtos {
public enum ExpirationType public enum ExpirationType
implements com.google.protobuf.ProtocolMessageEnum { implements com.google.protobuf.ProtocolMessageEnum {
/** /**
* <code>DELETE_AFTER_SEND = 1;</code> * <code>DELETE_AFTER_READ = 1;</code>
*/ */
DELETE_AFTER_SEND(0, 1), DELETE_AFTER_READ(0, 1),
/** /**
* <code>DELETE_AFTER_READ = 2;</code> * <code>DELETE_AFTER_SEND = 2;</code>
*/ */
DELETE_AFTER_READ(1, 2), DELETE_AFTER_SEND(1, 2),
; ;
/** /**
* <code>DELETE_AFTER_SEND = 1;</code> * <code>DELETE_AFTER_READ = 1;</code>
*/ */
public static final int DELETE_AFTER_SEND_VALUE = 1; public static final int DELETE_AFTER_READ_VALUE = 1;
/** /**
* <code>DELETE_AFTER_READ = 2;</code> * <code>DELETE_AFTER_SEND = 2;</code>
*/ */
public static final int DELETE_AFTER_READ_VALUE = 2; public static final int DELETE_AFTER_SEND_VALUE = 2;
public final int getNumber() { return value; } public final int getNumber() { return value; }
public static ExpirationType valueOf(int value) { public static ExpirationType valueOf(int value) {
switch (value) { switch (value) {
case 1: return DELETE_AFTER_SEND; case 1: return DELETE_AFTER_READ;
case 2: return DELETE_AFTER_READ; case 2: return DELETE_AFTER_SEND;
default: return null; default: return null;
} }
} }
@ -3079,7 +3079,7 @@ public final class SignalServiceProtos {
dataExtractionNotification_ = org.session.libsignal.protos.SignalServiceProtos.DataExtractionNotification.getDefaultInstance(); dataExtractionNotification_ = org.session.libsignal.protos.SignalServiceProtos.DataExtractionNotification.getDefaultInstance();
unsendRequest_ = org.session.libsignal.protos.SignalServiceProtos.UnsendRequest.getDefaultInstance(); unsendRequest_ = org.session.libsignal.protos.SignalServiceProtos.UnsendRequest.getDefaultInstance();
messageRequestResponse_ = org.session.libsignal.protos.SignalServiceProtos.MessageRequestResponse.getDefaultInstance(); messageRequestResponse_ = org.session.libsignal.protos.SignalServiceProtos.MessageRequestResponse.getDefaultInstance();
expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_SEND; expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ;
expirationTimer_ = 0; expirationTimer_ = 0;
lastDisappearingMessageChangeTimestamp_ = 0L; lastDisappearingMessageChangeTimestamp_ = 0L;
syncedExpiries_ = org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance(); syncedExpiries_ = org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance();
@ -3416,7 +3416,7 @@ public final class SignalServiceProtos {
messageRequestResponseBuilder_.clear(); messageRequestResponseBuilder_.clear();
} }
bitField0_ = (bitField0_ & ~0x00000080); bitField0_ = (bitField0_ & ~0x00000080);
expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_SEND; expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ;
bitField0_ = (bitField0_ & ~0x00000100); bitField0_ = (bitField0_ & ~0x00000100);
expirationTimer_ = 0; expirationTimer_ = 0;
bitField0_ = (bitField0_ & ~0x00000200); bitField0_ = (bitField0_ & ~0x00000200);
@ -4610,7 +4610,7 @@ public final class SignalServiceProtos {
} }
// optional .signalservice.Content.ExpirationType expirationType = 11; // optional .signalservice.Content.ExpirationType expirationType = 11;
private org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_SEND; private org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ;
/** /**
* <code>optional .signalservice.Content.ExpirationType expirationType = 11;</code> * <code>optional .signalservice.Content.ExpirationType expirationType = 11;</code>
*/ */
@ -4640,7 +4640,7 @@ public final class SignalServiceProtos {
*/ */
public Builder clearExpirationType() { public Builder clearExpirationType() {
bitField0_ = (bitField0_ & ~0x00000100); bitField0_ = (bitField0_ & ~0x00000100);
expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_SEND; expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ;
onChanged(); onChanged();
return this; return this;
} }
@ -28645,8 +28645,8 @@ public final class SignalServiceProtos {
"\022.\n&lastDisappearingMessageChangeTimesta" + "\022.\n&lastDisappearingMessageChangeTimesta" +
"mp\030\r \001(\004\0225\n\016syncedExpiries\030\016 \001(\0132\035.signa" + "mp\030\r \001(\004\0225\n\016syncedExpiries\030\016 \001(\0132\035.signa" +
"lservice.SyncedExpiries\">\n\016ExpirationTyp" + "lservice.SyncedExpiries\">\n\016ExpirationTyp" +
"e\022\025\n\021DELETE_AFTER_SEND\020\001\022\025\n\021DELETE_AFTER" + "e\022\025\n\021DELETE_AFTER_READ\020\001\022\025\n\021DELETE_AFTER" +
"_READ\020\002\"\265\002\n\016SyncedExpiries\022V\n\024conversati", "_SEND\020\002\"\265\002\n\016SyncedExpiries\022V\n\024conversati",
"onExpiries\030\001 \003(\01328.signalservice.SyncedE" + "onExpiries\030\001 \003(\01328.signalservice.SyncedE" +
"xpiries.SyncedConversationExpiries\032\312\001\n\032S" + "xpiries.SyncedConversationExpiries\032\312\001\n\032S" +
"yncedConversationExpiries\022\022\n\nsyncTarget\030" + "yncedConversationExpiries\022\022\n\nsyncTarget\030" +