From 4c9a237d8798b6178aba12c05c00ae0c61d4ac66 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Thu, 6 Jul 2023 14:48:05 +1000 Subject: [PATCH] fix: compile errors --- .../expiration/ExpirationSettingsViewModel.kt | 2 +- .../conversation/v2/ConversationActivityV2.kt | 7 +- .../database/helpers/SQLCipherOpenHelper.java | 3 +- .../AndroidAutoReplyReceiver.java | 2 +- .../notifications/RemoteReplyReceiver.java | 2 +- .../securesms/util/MockDataGenerator.kt | 9 +- .../main/res/layout/view_control_message.xml | 1 - app/src/main/res/values/strings.xml | 1 - .../libsession/messaging/messages/Message.kt | 5 +- .../control/MessageRequestResponse.kt | 7 +- .../sending_receiving/MessageSender.kt | 12 +- .../ReceivedMessageHandler.kt | 8 +- .../utilities/UpdateMessageBuilder.kt | 5 +- .../libsignal/protos/SignalServiceProtos.java | 381 +++++++++++++++++- 14 files changed, 392 insertions(+), 53 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt index 1346b60950..d559d42b84 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt @@ -121,7 +121,7 @@ class ExpirationSettingsViewModel( return@launch } - val expiryChangeTimestampMs = System.currentTimeMillis() + SnodeAPI.clockOffset + val expiryChangeTimestampMs = SnodeAPI.nowWithOffset storage.setExpirationConfiguration(ExpirationConfiguration(threadId, expirationTimer, expiryType, expiryChangeTimestampMs)) val message = ExpirationTimerUpdate(expirationTimer) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index 2c3e8203b3..1f24967cd3 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -154,6 +154,8 @@ import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities import org.thoughtcrime.securesms.util.DateUtils import org.thoughtcrime.securesms.util.MediaUtil import org.thoughtcrime.securesms.util.SaveAttachmentTask +import org.thoughtcrime.securesms.util.drawToBitmap +import org.thoughtcrime.securesms.util.isScrolledToBottom import org.thoughtcrime.securesms.util.push import org.thoughtcrime.securesms.util.show import org.thoughtcrime.securesms.util.toPx @@ -381,7 +383,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe } updateUnreadCountIndicator() - updateSubtitle() setUpBlockedBanner() binding!!.searchBottomBar.setEventListener(this) updateSendAfterApprovalText() @@ -699,7 +700,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe } setUpMessageRequestsBar() invalidateOptionsMenu() - updateSubtitle() updateSendAfterApprovalText() showOrHideInputIfNeeded() @@ -1451,7 +1451,8 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe processMessageRequestApproval() // Create the message val message = VisibleMessage() - message.sentTimestamp = SnodeAPI.nowWithOffset + val sentTimestampMs = SnodeAPI.nowWithOffset + message.sentTimestamp = sentTimestampMs message.text = body val quote = quotedMessage?.let { val quotedAttachments = (it as? MmsMessageRecord)?.slideDeck?.asAttachments() ?: listOf() diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java b/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java index 70e551b5ea..56eaf75181 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java @@ -86,9 +86,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { private static final int lokiV38 = 59; private static final int lokiV39 = 60; private static final int lokiV40 = 61; + private static final int lokiV41 = 62; // Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes - private static final int DATABASE_VERSION = lokiV40; + private static final int DATABASE_VERSION = lokiV41; private static final int MIN_DATABASE_VERSION = lokiV7; private static final String CIPHER3_DATABASE_NAME = "signal.db"; public static final String DATABASE_NAME = "signal_v4.db"; diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java b/app/src/main/java/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java index d5eb019644..bc7db0d418 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java @@ -85,7 +85,7 @@ public class AndroidAutoReplyReceiver extends BroadcastReceiver { VisibleMessage message = new VisibleMessage(); message.setText(responseText.toString()); - message.setSentTimestamp(SnodeAPI.getNowWithOffset() + SnodeAPI.INSTANCE.getClockOffset()); + message.setSentTimestamp(SnodeAPI.getNowWithOffset()); MessageSender.send(message, recipient.getAddress()); ExpirationConfiguration config = DatabaseComponent.get(context).expirationConfigurationDatabase().getExpirationConfiguration(threadId); long expiresInMillis = config == null ? 0 : config.getDurationSeconds() * 1000L; diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java b/app/src/main/java/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java index 0a7792ee3f..a7c34d14e1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java @@ -79,7 +79,7 @@ public class RemoteReplyReceiver extends BroadcastReceiver { ThreadDatabase threadDatabase = DatabaseComponent.get(context).threadDatabase(); long threadId = threadDatabase.getOrCreateThreadIdFor(recipient); VisibleMessage message = new VisibleMessage(); - message.setSentTimestamp(System.currentTimeMillis() + SnodeAPI.INSTANCE.getClockOffset()); + message.setSentTimestamp(SnodeAPI.getNowWithOffset()); message.setText(responseText.toString()); ExpirationConfiguration config = DatabaseComponent.get(context).expirationConfigurationDatabase().getExpirationConfiguration(threadId); long expiresInMillis = config == null ? 0 : config.getDurationSeconds() * 1000L; diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/MockDataGenerator.kt b/app/src/main/java/org/thoughtcrime/securesms/util/MockDataGenerator.kt index 10d507a538..46f1d901a3 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/MockDataGenerator.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/util/MockDataGenerator.kt @@ -7,8 +7,6 @@ import org.session.libsession.messaging.messages.signal.IncomingTextMessage import org.session.libsession.messaging.messages.signal.OutgoingTextMessage import org.session.libsession.messaging.open_groups.OpenGroup import org.session.libsession.messaging.open_groups.OpenGroupApi -import org.session.libsession.messaging.sending_receiving.notifications.PushNotificationAPI -import org.session.libsession.messaging.sending_receiving.pollers.ClosedGroupPollerV2 import org.session.libsession.utilities.Address import org.session.libsession.utilities.GroupUtil import org.session.libsession.utilities.recipients.Recipient @@ -21,7 +19,6 @@ import org.thoughtcrime.securesms.crypto.KeyPairUtilities import org.thoughtcrime.securesms.dependencies.DatabaseComponent import org.thoughtcrime.securesms.groups.GroupManager import java.security.SecureRandom -import java.util.* import kotlin.random.asKotlinRandom object MockDataGenerator { @@ -134,6 +131,7 @@ object MockDataGenerator { .joinToString(), Optional.absent(), 0, + 0, false, -1, false @@ -152,6 +150,7 @@ object MockDataGenerator { .map { wordContent.random(dmThreadRandomGenerator.asKotlinRandom()) } .joinToString(), 0, + 0, -1, (timestampNow - (index * 5000)) ), @@ -264,6 +263,7 @@ object MockDataGenerator { .joinToString(), Optional.absent(), 0, + 0, false, -1, false @@ -282,6 +282,7 @@ object MockDataGenerator { .map { wordContent.random(cgThreadRandomGenerator.asKotlinRandom()) } .joinToString(), 0, + 0, -1, (timestampNow - (index * 5000)) ), @@ -390,6 +391,7 @@ object MockDataGenerator { .joinToString(), Optional.absent(), 0, + 0, false, -1, false @@ -407,6 +409,7 @@ object MockDataGenerator { .map { wordContent.random(ogThreadRandomGenerator.asKotlinRandom()) } .joinToString(), 0, + 0, -1, (timestampNow - (index * 5000)) ), diff --git a/app/src/main/res/layout/view_control_message.xml b/app/src/main/res/layout/view_control_message.xml index 805683ace0..03923677db 100644 --- a/app/src/main/res/layout/view_control_message.xml +++ b/app/src/main/res/layout/view_control_message.xml @@ -34,7 +34,6 @@ android:contentDescription="@string/AccessibilityId_control_message" android:layout_width="match_parent" android:layout_height="wrap_content" - android:contentDescription="@string/AccessibilityId_configuration_message" android:gravity="center" android:textColor="?android:textColorPrimary" android:textSize="@dimen/very_small_font_size" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4fbe80dbe7..94ac345854 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -78,7 +78,6 @@ Call button Settings - Disappearing messages timer Time selector Accept message request Decline message request diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/Message.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/Message.kt index f9e3b38cae..78d9b66da7 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/Message.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/Message.kt @@ -39,16 +39,17 @@ abstract class Message { dataMessage.group = groupProto.build() } - fun SignalServiceProtos.Content.Builder.setExpirationConfigurationIfNeeded(threadId: Long?) { + fun SignalServiceProtos.Content.Builder.setExpirationConfigurationIfNeeded(threadId: Long?): SignalServiceProtos.Content.Builder { val config = threadId?.let { MessagingModuleConfiguration.shared.storage.getExpirationConfiguration(it) } ?: run { expirationTimer = 0 - return + return this } if (config.isEnabled) { expirationTimer = config.durationSeconds lastDisappearingMessageChangeTimestamp = config.updatedTimestampMs expirationType = config.expirationType } + return this } } \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/MessageRequestResponse.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/MessageRequestResponse.kt index e4124c30b0..65c7d9abd2 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/MessageRequestResponse.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/MessageRequestResponse.kt @@ -18,9 +18,10 @@ class MessageRequestResponse(val isApproved: Boolean, var profile: Profile? = nu .setProfile(profileProto.build()) profile?.profileKey?.let { messageRequestResponseProto.profileKey = ByteString.copyFrom(it) } return try { - messageRequestResponseProto.messageRequestResponse = messageRequestResponseProto.build() - messageRequestResponseProto.setExpirationConfigurationIfNeeded(threadID) - messageRequestResponseProto.build() + SignalServiceProtos.Content.newBuilder() + .setExpirationConfigurationIfNeeded(threadID) + .setMessageRequestResponse(messageRequestResponseProto.build()) + .build() } catch (e: Exception) { Log.w(TAG, "Couldn't construct message request response proto from: $this") null diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt index 37abbd2e19..458d34a39b 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt @@ -14,11 +14,6 @@ import org.session.libsession.messaging.messages.control.ConfigurationMessage import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate import org.session.libsession.messaging.messages.control.MessageRequestResponse import org.session.libsession.messaging.messages.control.UnsendRequest -import org.session.libsession.messaging.messages.control.CallMessage -import org.session.libsession.messaging.messages.control.ClosedGroupControlMessage -import org.session.libsession.messaging.messages.control.ConfigurationMessage -import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate -import org.session.libsession.messaging.messages.control.UnsendRequest import org.session.libsession.messaging.messages.visible.LinkPreview import org.session.libsession.messaging.messages.visible.Quote import org.session.libsession.messaging.messages.visible.VisibleMessage @@ -38,7 +33,12 @@ import org.session.libsession.utilities.SSKEnvironment import org.session.libsignal.crypto.PushTransportDetails import org.session.libsignal.protos.SignalServiceProtos import org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType -import org.session.libsignal.utilities.* +import org.session.libsignal.utilities.Base64 +import org.session.libsignal.utilities.IdPrefix +import org.session.libsignal.utilities.Namespace +import org.session.libsignal.utilities.defaultRequiresAuth +import org.session.libsignal.utilities.hasNamespaces +import org.session.libsignal.utilities.hexEncodedPublicKey import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicInteger import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt index a468927c84..5909e50f49 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt @@ -32,12 +32,6 @@ import org.session.libsession.messaging.utilities.SodiumUtilities import org.session.libsession.messaging.utilities.WebRtcUtils import org.session.libsession.snode.SnodeAPI import org.session.libsession.utilities.Address -import org.session.libsession.utilities.GroupRecord -import org.session.libsession.utilities.GroupUtil -import org.session.libsession.utilities.ProfileKeyUtil -import org.session.libsession.utilities.SSKEnvironment -import org.session.libsession.utilities.TextSecurePreferences -import org.session.libsession.utilities.Address import org.session.libsession.utilities.Address.Companion.fromSerialized import org.session.libsession.utilities.GroupRecord import org.session.libsession.utilities.GroupUtil @@ -282,7 +276,7 @@ fun MessageReceiver.updateExpiryIfNeeded(message: Message, proto: SignalServiceP // handle a delete after send expired fetch if (type == ExpirationType.DELETE_AFTER_SEND - && sentTime + configToUse.durationSeconds <= SnodeAPI.nowWithClockOffset) { + && sentTime + configToUse.durationSeconds <= SnodeAPI.nowWithOffset) { throw MessageReceiver.Error.ExpiredMessage } // handle a delete after read last known config value (test) TODO: actually implement this with shared config library diff --git a/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt b/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt index ccecf0b118..7c95b7f5c0 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt @@ -9,8 +9,8 @@ import org.session.libsession.messaging.messages.ExpirationConfiguration import org.session.libsession.messaging.sending_receiving.data_extraction.DataExtractionNotificationInfoMessage import org.session.libsession.utilities.Address import org.session.libsession.utilities.ExpirationUtil -import org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType import org.session.libsession.utilities.truncateIdForDisplay +import org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType object UpdateMessageBuilder { @@ -103,7 +103,8 @@ object UpdateMessageBuilder { } } else { val time = ExpirationUtil.getExpirationDisplayValue(context, duration.toInt()) - val config = storage.getExpirationConfiguration(storage.getOrCreateThreadIdFor(Address.fromSerialized(sender!!))) + val threadId = storage.getThreadId(Address.fromSerialized(senderId!!)) + val config = threadId?.let { storage.getExpirationConfiguration(it) } val state = when (config?.expirationType) { ExpirationType.DELETE_AFTER_SEND -> context.getString(R.string.MessageRecord_state_sent) ExpirationType.DELETE_AFTER_READ -> context.getString(R.string.MessageRecord_state_read) diff --git a/libsignal/src/main/java/org/session/libsignal/protos/SignalServiceProtos.java b/libsignal/src/main/java/org/session/libsignal/protos/SignalServiceProtos.java index 7c44087f83..46068a7ddc 100644 --- a/libsignal/src/main/java/org/session/libsignal/protos/SignalServiceProtos.java +++ b/libsignal/src/main/java/org/session/libsignal/protos/SignalServiceProtos.java @@ -2468,6 +2468,36 @@ public final class SignalServiceProtos { * optional .signalservice.MessageRequestResponse messageRequestResponse = 10; */ org.session.libsignal.protos.SignalServiceProtos.MessageRequestResponseOrBuilder getMessageRequestResponseOrBuilder(); + + // optional .signalservice.Content.ExpirationType expirationType = 11; + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + boolean hasExpirationType(); + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType getExpirationType(); + + // optional uint32 expirationTimer = 12; + /** + * optional uint32 expirationTimer = 12; + */ + boolean hasExpirationTimer(); + /** + * optional uint32 expirationTimer = 12; + */ + int getExpirationTimer(); + + // optional uint64 lastDisappearingMessageChangeTimestamp = 13; + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + boolean hasLastDisappearingMessageChangeTimestamp(); + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + long getLastDisappearingMessageChangeTimestamp(); } /** * Protobuf type {@code signalservice.Content} @@ -2624,6 +2654,27 @@ public final class SignalServiceProtos { bitField0_ |= 0x00000080; break; } + case 88: { + int rawValue = input.readEnum(); + org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType value = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(11, rawValue); + } else { + bitField0_ |= 0x00000100; + expirationType_ = value; + } + break; + } + case 96: { + bitField0_ |= 0x00000200; + expirationTimer_ = input.readUInt32(); + break; + } + case 104: { + bitField0_ |= 0x00000400; + lastDisappearingMessageChangeTimestamp_ = input.readUInt64(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -2663,6 +2714,88 @@ public final class SignalServiceProtos { return PARSER; } + /** + * Protobuf enum {@code signalservice.Content.ExpirationType} + */ + public enum ExpirationType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DELETE_AFTER_READ = 1; + */ + DELETE_AFTER_READ(0, 1), + /** + * DELETE_AFTER_SEND = 2; + */ + DELETE_AFTER_SEND(1, 2), + ; + + /** + * DELETE_AFTER_READ = 1; + */ + public static final int DELETE_AFTER_READ_VALUE = 1; + /** + * DELETE_AFTER_SEND = 2; + */ + public static final int DELETE_AFTER_SEND_VALUE = 2; + + + public final int getNumber() { return value; } + + public static ExpirationType valueOf(int value) { + switch (value) { + case 1: return DELETE_AFTER_READ; + case 2: return DELETE_AFTER_SEND; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExpirationType findValueByNumber(int number) { + return ExpirationType.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.session.libsignal.protos.SignalServiceProtos.Content.getDescriptor().getEnumTypes().get(0); + } + + private static final ExpirationType[] VALUES = values(); + + public static ExpirationType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private ExpirationType(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:signalservice.Content.ExpirationType) + } + private int bitField0_; // optional .signalservice.DataMessage dataMessage = 1; public static final int DATAMESSAGE_FIELD_NUMBER = 1; @@ -2840,6 +2973,54 @@ public final class SignalServiceProtos { return messageRequestResponse_; } + // optional .signalservice.Content.ExpirationType expirationType = 11; + public static final int EXPIRATIONTYPE_FIELD_NUMBER = 11; + private org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType expirationType_; + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + public boolean hasExpirationType() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + public org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType getExpirationType() { + return expirationType_; + } + + // optional uint32 expirationTimer = 12; + public static final int EXPIRATIONTIMER_FIELD_NUMBER = 12; + private int expirationTimer_; + /** + * optional uint32 expirationTimer = 12; + */ + public boolean hasExpirationTimer() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional uint32 expirationTimer = 12; + */ + public int getExpirationTimer() { + return expirationTimer_; + } + + // optional uint64 lastDisappearingMessageChangeTimestamp = 13; + public static final int LASTDISAPPEARINGMESSAGECHANGETIMESTAMP_FIELD_NUMBER = 13; + private long lastDisappearingMessageChangeTimestamp_; + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + public boolean hasLastDisappearingMessageChangeTimestamp() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + public long getLastDisappearingMessageChangeTimestamp() { + return lastDisappearingMessageChangeTimestamp_; + } + private void initFields() { dataMessage_ = org.session.libsignal.protos.SignalServiceProtos.DataMessage.getDefaultInstance(); callMessage_ = org.session.libsignal.protos.SignalServiceProtos.CallMessage.getDefaultInstance(); @@ -2849,6 +3030,9 @@ public final class SignalServiceProtos { dataExtractionNotification_ = org.session.libsignal.protos.SignalServiceProtos.DataExtractionNotification.getDefaultInstance(); unsendRequest_ = org.session.libsignal.protos.SignalServiceProtos.UnsendRequest.getDefaultInstance(); messageRequestResponse_ = org.session.libsignal.protos.SignalServiceProtos.MessageRequestResponse.getDefaultInstance(); + expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ; + expirationTimer_ = 0; + lastDisappearingMessageChangeTimestamp_ = 0L; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -2934,6 +3118,15 @@ public final class SignalServiceProtos { if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeMessage(10, messageRequestResponse_); } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeEnum(11, expirationType_.getNumber()); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeUInt32(12, expirationTimer_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeUInt64(13, lastDisappearingMessageChangeTimestamp_); + } getUnknownFields().writeTo(output); } @@ -2975,6 +3168,18 @@ public final class SignalServiceProtos { size += com.google.protobuf.CodedOutputStream .computeMessageSize(10, messageRequestResponse_); } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(11, expirationType_.getNumber()); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(12, expirationTimer_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(13, lastDisappearingMessageChangeTimestamp_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -3147,6 +3352,12 @@ public final class SignalServiceProtos { messageRequestResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000080); + expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ; + bitField0_ = (bitField0_ & ~0x00000100); + expirationTimer_ = 0; + bitField0_ = (bitField0_ & ~0x00000200); + lastDisappearingMessageChangeTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000400); return this; } @@ -3239,6 +3450,18 @@ public final class SignalServiceProtos { } else { result.messageRequestResponse_ = messageRequestResponseBuilder_.build(); } + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + result.expirationType_ = expirationType_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000200; + } + result.expirationTimer_ = expirationTimer_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000400; + } + result.lastDisappearingMessageChangeTimestamp_ = lastDisappearingMessageChangeTimestamp_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -3279,6 +3502,15 @@ public final class SignalServiceProtos { if (other.hasMessageRequestResponse()) { mergeMessageRequestResponse(other.getMessageRequestResponse()); } + if (other.hasExpirationType()) { + setExpirationType(other.getExpirationType()); + } + if (other.hasExpirationTimer()) { + setExpirationTimer(other.getExpirationTimer()); + } + if (other.hasLastDisappearingMessageChangeTimestamp()) { + setLastDisappearingMessageChangeTimestamp(other.getLastDisappearingMessageChangeTimestamp()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -4290,6 +4522,108 @@ public final class SignalServiceProtos { return messageRequestResponseBuilder_; } + // optional .signalservice.Content.ExpirationType expirationType = 11; + private org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ; + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + public boolean hasExpirationType() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + public org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType getExpirationType() { + return expirationType_; + } + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + public Builder setExpirationType(org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + expirationType_ = value; + onChanged(); + return this; + } + /** + * optional .signalservice.Content.ExpirationType expirationType = 11; + */ + public Builder clearExpirationType() { + bitField0_ = (bitField0_ & ~0x00000100); + expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_READ; + onChanged(); + return this; + } + + // optional uint32 expirationTimer = 12; + private int expirationTimer_ ; + /** + * optional uint32 expirationTimer = 12; + */ + public boolean hasExpirationTimer() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional uint32 expirationTimer = 12; + */ + public int getExpirationTimer() { + return expirationTimer_; + } + /** + * optional uint32 expirationTimer = 12; + */ + public Builder setExpirationTimer(int value) { + bitField0_ |= 0x00000200; + expirationTimer_ = value; + onChanged(); + return this; + } + /** + * optional uint32 expirationTimer = 12; + */ + public Builder clearExpirationTimer() { + bitField0_ = (bitField0_ & ~0x00000200); + expirationTimer_ = 0; + onChanged(); + return this; + } + + // optional uint64 lastDisappearingMessageChangeTimestamp = 13; + private long lastDisappearingMessageChangeTimestamp_ ; + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + public boolean hasLastDisappearingMessageChangeTimestamp() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + public long getLastDisappearingMessageChangeTimestamp() { + return lastDisappearingMessageChangeTimestamp_; + } + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + public Builder setLastDisappearingMessageChangeTimestamp(long value) { + bitField0_ |= 0x00000400; + lastDisappearingMessageChangeTimestamp_ = value; + onChanged(); + return this; + } + /** + * optional uint64 lastDisappearingMessageChangeTimestamp = 13; + */ + public Builder clearLastDisappearingMessageChangeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000400); + lastDisappearingMessageChangeTimestamp_ = 0L; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:signalservice.Content) } @@ -26115,7 +26449,7 @@ public final class SignalServiceProtos { "\002(\004\0223\n\006action\030\002 \002(\0162#.signalservice.Typi" + "ngMessage.Action\"\"\n\006Action\022\013\n\007STARTED\020\000\022" + "\013\n\007STOPPED\020\001\"2\n\rUnsendRequest\022\021\n\ttimesta", - "mp\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\"\345\003\n\007Content\022/\n\013" + + "mp\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\"\255\005\n\007Content\022/\n\013" + "dataMessage\030\001 \001(\0132\032.signalservice.DataMe" + "ssage\022/\n\013callMessage\030\003 \001(\0132\032.signalservi" + "ce.CallMessage\0225\n\016receiptMessage\030\005 \001(\0132\035" + @@ -26127,94 +26461,99 @@ public final class SignalServiceProtos { "e.DataExtractionNotification\0223\n\runsendRe", "quest\030\t \001(\0132\034.signalservice.UnsendReques" + "t\022E\n\026messageRequestResponse\030\n \001(\0132%.sign" + - "alservice.MessageRequestResponse\"0\n\007KeyP" + + "alservice.MessageRequestResponse\022=\n\016expi" + + "rationType\030\013 \001(\0162%.signalservice.Content" + + ".ExpirationType\022\027\n\017expirationTimer\030\014 \001(\r" + + "\022.\n&lastDisappearingMessageChangeTimesta" + + "mp\030\r \001(\004\">\n\016ExpirationType\022\025\n\021DELETE_AFT" + + "ER_READ\020\001\022\025\n\021DELETE_AFTER_SEND\020\002\"0\n\007KeyP" + "air\022\021\n\tpublicKey\030\001 \002(\014\022\022\n\nprivateKey\030\002 \002" + - "(\014\"\226\001\n\032DataExtractionNotification\022<\n\004typ" + + "(\014\"\226\001\n\032DataExtractionNotification\022<\n\004typ", "e\030\001 \002(\0162..signalservice.DataExtractionNo" + "tification.Type\022\021\n\ttimestamp\030\002 \001(\004\"\'\n\004Ty" + "pe\022\016\n\nSCREENSHOT\020\001\022\017\n\013MEDIA_SAVED\020\002\"\361\r\n\013" + "DataMessage\022\014\n\004body\030\001 \001(\t\0225\n\013attachments" + - "\030\002 \003(\0132 .signalservice.AttachmentPointer", + "\030\002 \003(\0132 .signalservice.AttachmentPointer" + "\022*\n\005group\030\003 \001(\0132\033.signalservice.GroupCon" + "text\022\r\n\005flags\030\004 \001(\r\022\023\n\013expireTimer\030\005 \001(\r" + "\022\022\n\nprofileKey\030\006 \001(\014\022\021\n\ttimestamp\030\007 \001(\004\022" + "/\n\005quote\030\010 \001(\0132 .signalservice.DataMessa" + - "ge.Quote\0223\n\007preview\030\n \003(\0132\".signalservic" + + "ge.Quote\0223\n\007preview\030\n \003(\0132\".signalservic", "e.DataMessage.Preview\0225\n\010reaction\030\013 \001(\0132" + "#.signalservice.DataMessage.Reaction\0227\n\007" + "profile\030e \001(\0132&.signalservice.DataMessag" + "e.LokiProfile\022K\n\023openGroupInvitation\030f \001" + - "(\0132..signalservice.DataMessage.OpenGroup", + "(\0132..signalservice.DataMessage.OpenGroup" + "Invitation\022W\n\031closedGroupControlMessage\030" + "h \001(\01324.signalservice.DataMessage.Closed" + "GroupControlMessage\022\022\n\nsyncTarget\030i \001(\t\032" + "\225\002\n\005Quote\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\022\014\n" + - "\004text\030\003 \001(\t\022F\n\013attachments\030\004 \003(\01321.signa" + + "\004text\030\003 \001(\t\022F\n\013attachments\030\004 \003(\01321.signa", "lservice.DataMessage.Quote.QuotedAttachm" + "ent\032\231\001\n\020QuotedAttachment\022\023\n\013contentType\030" + "\001 \001(\t\022\020\n\010fileName\030\002 \001(\t\0223\n\tthumbnail\030\003 \001" + "(\0132 .signalservice.AttachmentPointer\022\r\n\005" + - "flags\030\004 \001(\r\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\032", + "flags\030\004 \001(\r\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\032" + "V\n\007Preview\022\013\n\003url\030\001 \002(\t\022\r\n\005title\030\002 \001(\t\022/" + "\n\005image\030\003 \001(\0132 .signalservice.Attachment" + "Pointer\032:\n\013LokiProfile\022\023\n\013displayName\030\001 " + "\001(\t\022\026\n\016profilePicture\030\002 \001(\t\0320\n\023OpenGroup" + - "Invitation\022\013\n\003url\030\001 \002(\t\022\014\n\004name\030\003 \002(\t\032\374\003" + + "Invitation\022\013\n\003url\030\001 \002(\t\022\014\n\004name\030\003 \002(\t\032\374\003", "\n\031ClosedGroupControlMessage\022G\n\004type\030\001 \002(" + "\01629.signalservice.DataMessage.ClosedGrou" + "pControlMessage.Type\022\021\n\tpublicKey\030\002 \001(\014\022" + "\014\n\004name\030\003 \001(\t\0221\n\021encryptionKeyPair\030\004 \001(\013" + - "2\026.signalservice.KeyPair\022\017\n\007members\030\005 \003(", + "2\026.signalservice.KeyPair\022\017\n\007members\030\005 \003(" + "\014\022\016\n\006admins\030\006 \003(\014\022U\n\010wrappers\030\007 \003(\0132C.si" + "gnalservice.DataMessage.ClosedGroupContr" + "olMessage.KeyPairWrapper\022\027\n\017expirationTi" + "mer\030\010 \001(\r\032=\n\016KeyPairWrapper\022\021\n\tpublicKey" + - "\030\001 \002(\014\022\030\n\020encryptedKeyPair\030\002 \002(\014\"r\n\004Type" + + "\030\001 \002(\014\022\030\n\020encryptedKeyPair\030\002 \002(\014\"r\n\004Type", "\022\007\n\003NEW\020\001\022\027\n\023ENCRYPTION_KEY_PAIR\020\003\022\017\n\013NA" + "ME_CHANGE\020\004\022\021\n\rMEMBERS_ADDED\020\005\022\023\n\017MEMBER" + "S_REMOVED\020\006\022\017\n\013MEMBER_LEFT\020\007\032\222\001\n\010Reactio" + "n\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\022\r\n\005emoji\030\003" + - " \001(\t\022:\n\006action\030\004 \002(\0162*.signalservice.Dat", + " \001(\t\022:\n\006action\030\004 \002(\0162*.signalservice.Dat" + "aMessage.Reaction.Action\"\037\n\006Action\022\t\n\005RE" + "ACT\020\000\022\n\n\006REMOVE\020\001\"$\n\005Flags\022\033\n\027EXPIRATION" + "_TIMER_UPDATE\020\002\"\352\001\n\013CallMessage\022-\n\004type\030" + "\001 \002(\0162\037.signalservice.CallMessage.Type\022\014" + - "\n\004sdps\030\002 \003(\t\022\027\n\017sdpMLineIndexes\030\003 \003(\r\022\017\n" + + "\n\004sdps\030\002 \003(\t\022\027\n\017sdpMLineIndexes\030\003 \003(\r\022\017\n", "\007sdpMids\030\004 \003(\t\022\014\n\004uuid\030\005 \002(\t\"f\n\004Type\022\r\n\t" + "PRE_OFFER\020\006\022\t\n\005OFFER\020\001\022\n\n\006ANSWER\020\002\022\026\n\022PR" + "OVISIONAL_ANSWER\020\003\022\022\n\016ICE_CANDIDATES\020\004\022\014" + "\n\010END_CALL\020\005\"\245\004\n\024ConfigurationMessage\022E\n" + - "\014closedGroups\030\001 \003(\0132/.signalservice.Conf", + "\014closedGroups\030\001 \003(\0132/.signalservice.Conf" + "igurationMessage.ClosedGroup\022\022\n\nopenGrou" + "ps\030\002 \003(\t\022\023\n\013displayName\030\003 \001(\t\022\026\n\016profile" + "Picture\030\004 \001(\t\022\022\n\nprofileKey\030\005 \001(\014\022=\n\010con" + "tacts\030\006 \003(\0132+.signalservice.Configuratio" + - "nMessage.Contact\032\233\001\n\013ClosedGroup\022\021\n\tpubl" + + "nMessage.Contact\032\233\001\n\013ClosedGroup\022\021\n\tpubl", "icKey\030\001 \001(\014\022\014\n\004name\030\002 \001(\t\0221\n\021encryptionK" + "eyPair\030\003 \001(\0132\026.signalservice.KeyPair\022\017\n\007" + "members\030\004 \003(\014\022\016\n\006admins\030\005 \003(\014\022\027\n\017expirat" + "ionTimer\030\006 \001(\r\032\223\001\n\007Contact\022\021\n\tpublicKey\030" + - "\001 \002(\014\022\014\n\004name\030\002 \002(\t\022\026\n\016profilePicture\030\003 ", + "\001 \002(\014\022\014\n\004name\030\002 \002(\t\022\026\n\016profilePicture\030\003 " + "\001(\t\022\022\n\nprofileKey\030\004 \001(\014\022\022\n\nisApproved\030\005 " + "\001(\010\022\021\n\tisBlocked\030\006 \001(\010\022\024\n\014didApproveMe\030\007" + " \001(\010\"y\n\026MessageRequestResponse\022\022\n\nisAppr" + "oved\030\001 \002(\010\022\022\n\nprofileKey\030\002 \001(\014\0227\n\007profil" + - "e\030\003 \001(\0132&.signalservice.DataMessage.Loki" + + "e\030\003 \001(\0132&.signalservice.DataMessage.Loki", "Profile\"u\n\016ReceiptMessage\0220\n\004type\030\001 \002(\0162" + "\".signalservice.ReceiptMessage.Type\022\021\n\tt" + "imestamp\030\002 \003(\004\"\036\n\004Type\022\014\n\010DELIVERY\020\000\022\010\n\004" + "READ\020\001\"\354\001\n\021AttachmentPointer\022\n\n\002id\030\001 \002(\006" + - "\022\023\n\013contentType\030\002 \001(\t\022\013\n\003key\030\003 \001(\014\022\014\n\004si", + "\022\023\n\013contentType\030\002 \001(\t\022\013\n\003key\030\003 \001(\014\022\014\n\004si" + "ze\030\004 \001(\r\022\021\n\tthumbnail\030\005 \001(\014\022\016\n\006digest\030\006 " + "\001(\014\022\020\n\010fileName\030\007 \001(\t\022\r\n\005flags\030\010 \001(\r\022\r\n\005" + "width\030\t \001(\r\022\016\n\006height\030\n \001(\r\022\017\n\007caption\030\013" + " \001(\t\022\013\n\003url\030e \001(\t\"\032\n\005Flags\022\021\n\rVOICE_MESS" + - "AGE\020\001\"\365\001\n\014GroupContext\022\n\n\002id\030\001 \001(\014\022.\n\004ty" + + "AGE\020\001\"\365\001\n\014GroupContext\022\n\n\002id\030\001 \001(\014\022.\n\004ty", "pe\030\002 \001(\0162 .signalservice.GroupContext.Ty" + "pe\022\014\n\004name\030\003 \001(\t\022\017\n\007members\030\004 \003(\t\0220\n\006ava" + "tar\030\005 \001(\0132 .signalservice.AttachmentPoin" + "ter\022\016\n\006admins\030\006 \003(\t\"H\n\004Type\022\013\n\007UNKNOWN\020\000" + - "\022\n\n\006UPDATE\020\001\022\013\n\007DELIVER\020\002\022\010\n\004QUIT\020\003\022\020\n\014R", + "\022\n\n\006UPDATE\020\001\022\013\n\007DELIVER\020\002\022\010\n\004QUIT\020\003\022\020\n\014R" + "EQUEST_INFO\020\004B3\n\034org.session.libsignal.p" + "rotosB\023SignalServiceProtos" }; @@ -26246,7 +26585,7 @@ public final class SignalServiceProtos { internal_static_signalservice_Content_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_Content_descriptor, - new java.lang.String[] { "DataMessage", "CallMessage", "ReceiptMessage", "TypingMessage", "ConfigurationMessage", "DataExtractionNotification", "UnsendRequest", "MessageRequestResponse", }); + new java.lang.String[] { "DataMessage", "CallMessage", "ReceiptMessage", "TypingMessage", "ConfigurationMessage", "DataExtractionNotification", "UnsendRequest", "MessageRequestResponse", "ExpirationType", "ExpirationTimer", "LastDisappearingMessageChangeTimestamp", }); internal_static_signalservice_KeyPair_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_signalservice_KeyPair_fieldAccessorTable = new