From 6eba3ac8af0727c27f44a45585b79f66731db377 Mon Sep 17 00:00:00 2001 From: charles Date: Wed, 16 Nov 2022 10:45:58 +1100 Subject: [PATCH] Update expiry configuration --- .../expiration/ExpirationSettingsActivity.kt | 11 +- .../securesms/database/Storage.kt | 13 + app/src/main/res/menu/menu_conversation.xml | 1 - .../libsession/database/StorageProtocol.kt | 6 +- .../messaging/jobs/DisappearingMessagesJob.kt | 64 + .../ExpirationSettingsConfiguration.kt | 11 + .../libsession/messaging/messages/Message.kt | 14 +- .../messaging/messages/control/CallMessage.kt | 13 +- .../control/ClosedGroupControlMessage.kt | 4 +- .../control/DataExtractionNotification.kt | 1 + .../control/MessageRequestResponse.kt | 7 +- .../messaging/messages/control/ReadReceipt.kt | 7 +- .../messages/control/SyncedExpiriesMessage.kt | 61 + .../messages/control/SyncedExpiry.kt | 35 + .../messages/control/TypingIndicator.kt | 9 +- .../messages/control/UnsendRequest.kt | 7 +- .../messages/visible/VisibleMessage.kt | 15 +- .../sending_receiving/MessageReceiver.kt | 2 + .../sending_receiving/MessageSender.kt | 21 +- .../ReceivedMessageHandler.kt | 37 + .../org/session/libsession/snode/SnodeAPI.kt | 56 + libsignal/protobuf/SignalService.proto | 21 +- .../libsignal/protos/SignalServiceProtos.java | 2592 ++++++++++++++--- .../org/session/libsignal/utilities/Snode.kt | 3 +- 24 files changed, 2623 insertions(+), 388 deletions(-) create mode 100644 libsession/src/main/java/org/session/libsession/messaging/jobs/DisappearingMessagesJob.kt create mode 100644 libsession/src/main/java/org/session/libsession/messaging/messages/ExpirationSettingsConfiguration.kt create mode 100644 libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiriesMessage.kt create mode 100644 libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiry.kt diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt index a5474b44b3..caf9925262 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt @@ -12,6 +12,7 @@ import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.RecyclerView import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch +import network.loki.messenger.BuildConfig import network.loki.messenger.R import network.loki.messenger.databinding.ActivityExpirationSettingsBinding import org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType @@ -41,7 +42,15 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() { .zip(resources.getStringArray(R.array.read_expiration_time_names)) { value, name -> RadioOption(value, name)} val afterSendOptions = resources.getIntArray(R.array.send_expiration_time_values).map(Int::toString) .zip(resources.getStringArray(R.array.send_expiration_time_names)) { value, name -> RadioOption(value, name)} - viewModelFactory.create(threadId, afterReadOptions, afterSendOptions) + viewModelFactory.create(threadId, mayAddTestExpiryOption(afterReadOptions), mayAddTestExpiryOption(afterSendOptions)) + } + + private fun mayAddTestExpiryOption(expiryOptions: List): List { + return if (BuildConfig.DEBUG) { + val options = expiryOptions.toMutableList() + options.add(1, RadioOption("60", "1 Minute")) + options + } else expiryOptions } override fun onSaveInstanceState(outState: Bundle) { diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt index 76849b8af6..85ae536155 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -12,6 +12,7 @@ import org.session.libsession.messaging.jobs.Job import org.session.libsession.messaging.jobs.JobQueue import org.session.libsession.messaging.jobs.MessageReceiveJob import org.session.libsession.messaging.jobs.MessageSendJob +import org.session.libsession.messaging.messages.ExpirationSettingsConfiguration import org.session.libsession.messaging.messages.Message import org.session.libsession.messaging.messages.control.ConfigurationMessage import org.session.libsession.messaging.messages.control.MessageRequestResponse @@ -961,4 +962,16 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context, return recipientDb.blockedContacts } + override fun getExpirationSettingsConfiguration(threadId: Long): ExpirationSettingsConfiguration? { + return null + } + + override fun addExpirationSettingsConfiguration(config: ExpirationSettingsConfiguration) { + + } + + override fun getExpiringMessages(messageIds: LongArray): List> { + return emptyList() + } + } \ No newline at end of file diff --git a/app/src/main/res/menu/menu_conversation.xml b/app/src/main/res/menu/menu_conversation.xml index 16426221ab..e4be60f324 100644 --- a/app/src/main/res/menu/menu_conversation.xml +++ b/app/src/main/res/menu/menu_conversation.xml @@ -6,7 +6,6 @@ diff --git a/libsession/src/main/java/org/session/libsession/database/StorageProtocol.kt b/libsession/src/main/java/org/session/libsession/database/StorageProtocol.kt index f35e5de0d4..675ab21b75 100644 --- a/libsession/src/main/java/org/session/libsession/database/StorageProtocol.kt +++ b/libsession/src/main/java/org/session/libsession/database/StorageProtocol.kt @@ -8,6 +8,7 @@ import org.session.libsession.messaging.contacts.Contact import org.session.libsession.messaging.jobs.AttachmentUploadJob import org.session.libsession.messaging.jobs.Job import org.session.libsession.messaging.jobs.MessageSendJob +import org.session.libsession.messaging.messages.ExpirationSettingsConfiguration import org.session.libsession.messaging.messages.Message import org.session.libsession.messaging.messages.control.ConfigurationMessage import org.session.libsession.messaging.messages.control.MessageRequestResponse @@ -144,7 +145,7 @@ interface StorageProtocol { // Thread fun getOrCreateThreadIdFor(address: Address): Long - fun getOrCreateThreadIdFor(publicKey: String, groupPublicKey: String?, openGroupID: String?): Long + fun getOrCreateThreadIdFor(publicKey: String, groupPublicKey: String? = null, openGroupID: String? = null): Long fun getThreadId(publicKeyOrOpenGroupID: String): Long? fun getThreadId(address: Address): Long? fun getThreadId(recipient: Recipient): Long? @@ -198,4 +199,7 @@ interface StorageProtocol { fun deleteReactions(messageId: Long, mms: Boolean) fun unblock(toUnblock: List) fun blockedContacts(): List + fun getExpirationSettingsConfiguration(threadId: Long): ExpirationSettingsConfiguration? + fun addExpirationSettingsConfiguration(config: ExpirationSettingsConfiguration) + fun getExpiringMessages(messageIds: LongArray): List> } diff --git a/libsession/src/main/java/org/session/libsession/messaging/jobs/DisappearingMessagesJob.kt b/libsession/src/main/java/org/session/libsession/messaging/jobs/DisappearingMessagesJob.kt new file mode 100644 index 0000000000..50f9c9e22b --- /dev/null +++ b/libsession/src/main/java/org/session/libsession/messaging/jobs/DisappearingMessagesJob.kt @@ -0,0 +1,64 @@ +package org.session.libsession.messaging.jobs + +import org.session.libsession.messaging.MessagingModuleConfiguration +import org.session.libsession.messaging.messages.control.SyncedExpiriesMessage +import org.session.libsession.messaging.messages.control.SyncedExpiry +import org.session.libsession.messaging.sending_receiving.MessageSender +import org.session.libsession.messaging.utilities.Data +import org.session.libsession.snode.SnodeAPI +import org.session.libsession.utilities.Address + +class DisappearingMessagesJob(val messageIds: LongArray, val startedAtMs: Long): Job { + + override var delegate: JobDelegate? = null + override var id: String? = null + override var failureCount: Int = 0 + override val maxFailureCount: Int = 1 + + override fun execute() { + val userPublicKey = MessagingModuleConfiguration.shared.storage.getUserPublicKey() ?: return + val module = MessagingModuleConfiguration.shared + try { + module.storage.getExpiringMessages(messageIds).groupBy { it.second }.forEach { (expiresInSeconds, messages) -> + val serverHashes = messages.map { it.first } + if (serverHashes.isEmpty()) return + val expirationTimestamp = startedAtMs + expiresInSeconds * 1000 + val syncTarget = "" + val syncedExpiriesMessage = SyncedExpiriesMessage() + syncedExpiriesMessage.conversationExpiries = mapOf( + syncTarget to serverHashes.map { serverHash -> SyncedExpiry(serverHash, expirationTimestamp) } + ) + MessageSender.send(syncedExpiriesMessage, Address.fromSerialized(userPublicKey)) + SnodeAPI.updateExpiry(expirationTimestamp, serverHashes) + } + } catch (e: Exception) { + delegate?.handleJobFailed(this, e) + return + } + delegate?.handleJobSucceeded(this) + } + + override fun serialize(): Data = Data.Builder() + .putLongArray(MESSAGE_IDS, messageIds) + .putLong(STARTED_AT_MS, startedAtMs) + .build() + + override fun getFactoryKey(): String = KEY + + class Factory : Job.Factory { + override fun create(data: Data): DisappearingMessagesJob { + return DisappearingMessagesJob( + data.getLongArray(MESSAGE_IDS), + data.getLong(STARTED_AT_MS) + ) + } + } + + companion object { + const val KEY = "DisappearingMessagesJob" + + private const val MESSAGE_IDS = "messageIds" + private const val STARTED_AT_MS = "startedAtMs" + } + +} \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/ExpirationSettingsConfiguration.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/ExpirationSettingsConfiguration.kt new file mode 100644 index 0000000000..ee11a2c889 --- /dev/null +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/ExpirationSettingsConfiguration.kt @@ -0,0 +1,11 @@ +package org.session.libsession.messaging.messages + +import org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType + +class ExpirationSettingsConfiguration( + val threadId: Long = -1, + val isEnabled: Boolean = false, + val durationSeconds: Int = 0, + val expirationType: ExpirationType? = null, + val lastChangeTimestampMs: Long = 0 +) \ No newline at end of file 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 d201daa98d..b934254245 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 @@ -1,6 +1,7 @@ package org.session.libsession.messaging.messages import com.google.protobuf.ByteString +import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.utilities.GroupUtil import org.session.libsignal.protos.SignalServiceProtos @@ -14,8 +15,10 @@ abstract class Message { var groupPublicKey: String? = null var openGroupServerMessageID: Long? = null var serverHash: String? = null + var specifiedTtl: Long? = null - open val ttl: Long = 14 * 24 * 60 * 60 * 1000 + open val defaultTtl: Long = 14 * 24 * 60 * 60 * 1000 + val ttl: Long get() = specifiedTtl ?: defaultTtl open val isSelfSendValid: Boolean = false open fun isValid(): Boolean { @@ -36,4 +39,13 @@ abstract class Message { dataMessage.group = groupProto.build() } + fun setExpirationSettingsConfigIfNeeded(builder: SignalServiceProtos.Content.Builder) { + val threadId = threadID ?: return + val config = MessagingModuleConfiguration.shared.storage.getExpirationSettingsConfiguration(threadId) ?: return + builder.expirationTimer = config.durationSeconds + if (config.isEnabled) { + builder.expirationType = config.expirationType + builder.lastDisappearingMessageChangeTimestamp = config.lastChangeTimestampMs + } + } } \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/CallMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/CallMessage.kt index 0befa5f4a3..d7bc29e6ae 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/CallMessage.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/CallMessage.kt @@ -14,10 +14,10 @@ class CallMessage(): ControlMessage() { override val isSelfSendValid: Boolean get() = type in arrayOf(ANSWER, END_CALL) - override val ttl: Long = 300000L // 5m + override val defaultTtl: Long = 300000L // 5m override fun isValid(): Boolean = super.isValid() && type != null && callId != null - && (!sdps.isNullOrEmpty() || type in listOf(END_CALL, PRE_OFFER)) + && (sdps.isNotEmpty() || type in listOf(END_CALL, PRE_OFFER)) constructor(type: SignalServiceProtos.CallMessage.Type, sdps: List, @@ -81,10 +81,11 @@ class CallMessage(): ControlMessage() { .addAllSdpMids(sdpMids) .setUuid(callId!!.toString()) - return SignalServiceProtos.Content.newBuilder() - .setCallMessage( - callMessage - ) + val content = SignalServiceProtos.Content.newBuilder() + setExpirationSettingsConfigIfNeeded(content) + + return content + .setCallMessage(callMessage) .build() } diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt index c7aa03a7b2..433d192dbf 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt @@ -14,7 +14,7 @@ import org.session.libsignal.utilities.Log class ClosedGroupControlMessage() : ControlMessage() { var kind: Kind? = null - override val ttl: Long get() { + override val defaultTtl: Long get() { return when (kind) { is Kind.EncryptionKeyPair -> 14 * 24 * 60 * 60 * 1000 else -> 14 * 24 * 60 * 60 * 1000 @@ -167,6 +167,8 @@ class ClosedGroupControlMessage() : ControlMessage() { val contentProto = SignalServiceProtos.Content.newBuilder() val dataMessageProto = DataMessage.newBuilder() dataMessageProto.closedGroupControlMessage = closedGroupControlMessage.build() + // Expiration timer + setExpirationSettingsConfigIfNeeded(contentProto) // Group context setGroupContext(dataMessageProto) contentProto.dataMessage = dataMessageProto.build() diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/DataExtractionNotification.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/DataExtractionNotification.kt index a637b26326..b1f6cb6bad 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/DataExtractionNotification.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/DataExtractionNotification.kt @@ -64,6 +64,7 @@ class DataExtractionNotification() : ControlMessage() { } val contentProto = SignalServiceProtos.Content.newBuilder() contentProto.dataExtractionNotification = dataExtractionNotification.build() + setExpirationSettingsConfigIfNeeded(contentProto) return contentProto.build() } catch (e: Exception) { Log.w(TAG, "Couldn't construct data extraction notification proto from: $this") 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 f5a65e4ca4..d5b8ebd279 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 @@ -10,10 +10,11 @@ class MessageRequestResponse(val isApproved: Boolean) : ControlMessage() { override fun toProto(): SignalServiceProtos.Content? { val messageRequestResponseProto = SignalServiceProtos.MessageRequestResponse.newBuilder() .setIsApproved(isApproved) + val contentProto = SignalServiceProtos.Content.newBuilder() return try { - SignalServiceProtos.Content.newBuilder() - .setMessageRequestResponse(messageRequestResponseProto.build()) - .build() + contentProto.messageRequestResponse = messageRequestResponseProto.build() + setExpirationSettingsConfigIfNeeded(contentProto) + contentProto.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/messages/control/ReadReceipt.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/ReadReceipt.kt index e0c7b690bc..7159306c68 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/ReadReceipt.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/ReadReceipt.kt @@ -39,12 +39,13 @@ class ReadReceipt() : ControlMessage() { receiptProto.type = SignalServiceProtos.ReceiptMessage.Type.READ receiptProto.addAllTimestamp(timestamps.asIterable()) val contentProto = SignalServiceProtos.Content.newBuilder() - try { + return try { contentProto.receiptMessage = receiptProto.build() - return contentProto.build() + setExpirationSettingsConfigIfNeeded(contentProto) + contentProto.build() } catch (e: Exception) { Log.w(TAG, "Couldn't construct read receipt proto from: $this") - return null + null } } } \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiriesMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiriesMessage.kt new file mode 100644 index 0000000000..b1b1befc0a --- /dev/null +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiriesMessage.kt @@ -0,0 +1,61 @@ +package org.session.libsession.messaging.messages.control + +import org.session.libsignal.protos.SignalServiceProtos +import org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries +import org.session.libsignal.utilities.Log + +class SyncedExpiriesMessage(): ControlMessage() { + var conversationExpiries: Map> = emptyMap() + + override val isSelfSendValid: Boolean = true + + // region Validation + override fun isValid(): Boolean { + if (!super.isValid()) return false + return conversationExpiries.isNotEmpty() + } + // endregion + + companion object { + const val TAG = "SyncedExpiriesMessage" + + fun fromProto(proto: SignalServiceProtos.Content): SyncedExpiriesMessage? { + val syncedExpiriesProto = if (proto.hasSyncedExpiries()) proto.syncedExpiries else return null + val conversationExpiries = syncedExpiriesProto.conversationExpiriesList.associate { + it.syncTarget to it.expiriesList.map { syncedExpiry -> SyncedExpiry.fromProto(syncedExpiry) } + } + return SyncedExpiriesMessage(conversationExpiries) + } + } + + constructor(conversationExpiries: Map>) : this() { + this.conversationExpiries = conversationExpiries + } + + override fun toProto(): SignalServiceProtos.Content? { + val conversationExpiries = conversationExpiries + if (conversationExpiries.isEmpty()) { + Log.w(TAG, "Couldn't construct synced expiries proto from: $this") + return null + } + val conversationExpiriesProto = conversationExpiries.map { (syncTarget, syncedExpiries) -> + val expiriesProto = syncedExpiries.map(SyncedExpiry::toProto) + val syncedConversationExpiriesProto = SyncedConversationExpiries.newBuilder() + syncedConversationExpiriesProto.syncTarget = syncTarget + syncedConversationExpiriesProto.addAllExpiries(expiriesProto) + syncedConversationExpiriesProto.build() + } + val syncedExpiriesProto = SignalServiceProtos.SyncedExpiries.newBuilder() + syncedExpiriesProto.addAllConversationExpiries(conversationExpiriesProto) + val contentProto = SignalServiceProtos.Content.newBuilder() + return try { + contentProto.syncedExpiries = syncedExpiriesProto.build() + setExpirationSettingsConfigIfNeeded(contentProto) + contentProto.build() + } catch (e: Exception) { + Log.w(TAG, "Couldn't construct synced expiries proto from: $this") + null + } + } + +} \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiry.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiry.kt new file mode 100644 index 0000000000..405174d0ec --- /dev/null +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/SyncedExpiry.kt @@ -0,0 +1,35 @@ +package org.session.libsession.messaging.messages.control + +import org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries +import org.session.libsignal.utilities.Log + +class SyncedExpiry( + var serverHash: String? = null, + var expirationTimestamp: Long? = null +) { + + fun toProto(): SyncedExpiries.SyncedConversationExpiries.SyncedExpiry? { + val syncedExpiryProto = SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.newBuilder() + serverHash?.let { syncedExpiryProto.serverHash = it } + expirationTimestamp?.let { syncedExpiryProto.expirationTimestamp = it } + return try { + syncedExpiryProto.build() + } catch (e: Exception) { + Log.w(TAG, "Couldn't construct synced expiry proto from: $this") + null + } + } + + companion object { + const val TAG = "SyncedExpiry" + + @JvmStatic + fun fromProto(proto: SyncedExpiries.SyncedConversationExpiries.SyncedExpiry): SyncedExpiry { + val result = SyncedExpiry() + result.serverHash = if (proto.hasServerHash()) proto.serverHash else null + result.expirationTimestamp = if (proto.hasServerHash()) proto.expirationTimestamp else null + return SyncedExpiry() + } + } + + } \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/TypingIndicator.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/TypingIndicator.kt index c755751ba6..083405af9b 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/TypingIndicator.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/TypingIndicator.kt @@ -6,7 +6,7 @@ import org.session.libsignal.utilities.Log class TypingIndicator() : ControlMessage() { var kind: Kind? = null - override val ttl: Long = 20 * 1000 + override val defaultTtl: Long = 20 * 1000 override fun isValid(): Boolean { if (!super.isValid()) return false @@ -58,12 +58,13 @@ class TypingIndicator() : ControlMessage() { typingIndicatorProto.timestamp = timestamp typingIndicatorProto.action = kind.toProto() val contentProto = SignalServiceProtos.Content.newBuilder() - try { + return try { contentProto.typingMessage = typingIndicatorProto.build() - return contentProto.build() + setExpirationSettingsConfigIfNeeded(contentProto) + contentProto.build() } catch (e: Exception) { Log.w(TAG, "Couldn't construct typing indicator proto from: $this") - return null + null } } } \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/UnsendRequest.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/UnsendRequest.kt index a22dd93348..04952f0524 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/UnsendRequest.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/UnsendRequest.kt @@ -43,12 +43,13 @@ class UnsendRequest(): ControlMessage() { unsendRequestProto.timestamp = timestamp unsendRequestProto.author = author val contentProto = SignalServiceProtos.Content.newBuilder() - try { + return try { contentProto.unsendRequest = unsendRequestProto.build() - return contentProto.build() + setExpirationSettingsConfigIfNeeded(contentProto) + contentProto.build() } catch (e: Exception) { Log.w(TAG, "Couldn't construct unsend request proto from: $this") - return null + null } } diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt index 2891400c9a..bc7683299a 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt @@ -4,9 +4,6 @@ import com.goterl.lazysodium.BuildConfig import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.messages.Message import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAttachment -import org.session.libsession.utilities.Address -import org.session.libsession.utilities.GroupUtil -import org.session.libsession.utilities.recipients.Recipient import org.session.libsignal.protos.SignalServiceProtos import org.session.libsignal.utilities.Log import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment @@ -119,17 +116,9 @@ class VisibleMessage : Message() { dataMessage.addAllAttachments(pointers) // TODO: Contact // Expiration timer - // TODO: We * want * expiration timer updates to be explicit. But currently Android will disable the expiration timer for a conversation - // if it receives a message without the current expiration timer value attached to it... - val storage = MessagingModuleConfiguration.shared.storage - val context = MessagingModuleConfiguration.shared.context - val expiration = if (storage.isClosedGroup(recipient!!)) { - Recipient.from(context, Address.fromSerialized(GroupUtil.doubleEncodeGroupID(recipient!!)), false).expireMessages - } else { - Recipient.from(context, Address.fromSerialized(recipient!!), false).expireMessages - } - dataMessage.expireTimer = expiration + setExpirationSettingsConfigIfNeeded(proto) // Group context + val storage = MessagingModuleConfiguration.shared.storage if (storage.isClosedGroup(recipient!!)) { try { setGroupContext(dataMessage) diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiver.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiver.kt index 6a38a551f8..1dfb7650ce 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiver.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiver.kt @@ -9,6 +9,7 @@ import org.session.libsession.messaging.messages.control.DataExtractionNotificat import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate import org.session.libsession.messaging.messages.control.MessageRequestResponse import org.session.libsession.messaging.messages.control.ReadReceipt +import org.session.libsession.messaging.messages.control.SyncedExpiriesMessage import org.session.libsession.messaging.messages.control.TypingIndicator import org.session.libsession.messaging.messages.control.UnsendRequest import org.session.libsession.messaging.messages.visible.VisibleMessage @@ -138,6 +139,7 @@ object MessageReceiver { UnsendRequest.fromProto(proto) ?: MessageRequestResponse.fromProto(proto) ?: CallMessage.fromProto(proto) ?: + SyncedExpiriesMessage.fromProto(proto) ?: VisibleMessage.fromProto(proto) ?: run { throw Error.UnknownMessage } 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 d6a4618d96..5a35864ba2 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 @@ -32,6 +32,7 @@ import org.session.libsession.utilities.GroupUtil 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.Base64 import org.session.libsignal.utilities.IdPrefix import org.session.libsignal.utilities.Namespace @@ -171,7 +172,12 @@ object MessageSender { val base64EncodedData = Base64.encodeBytes(wrappedMessage) // Send the result val timestamp = messageSendTime + SnodeAPI.clockOffset - val snodeMessage = SnodeMessage(message.recipient!!, base64EncodedData, message.ttl, timestamp) + val snodeMessage = SnodeMessage( + recipient = message.recipient!!, + data = base64EncodedData, + ttl = getSpecifiedTtl(message, isSyncMessage) ?: message.ttl, + timestamp = timestamp + ) if (destination is Destination.Contact && message is VisibleMessage && !isSelfSend) { SnodeModule.shared.broadcaster.broadcast("sendingMessage", messageSendTime) } @@ -214,6 +220,19 @@ object MessageSender { return promise } + private fun getSpecifiedTtl(message: Message, isSyncMessage: Boolean): Long? { + val storage = MessagingModuleConfiguration.shared.storage + val threadId = message.threadID + ?: run { + val address = if (isSyncMessage && message is VisibleMessage) message.syncTarget else message.recipient + storage.getOrCreateThreadIdFor(address!!) + } + val config = storage.getExpirationSettingsConfiguration(threadId) ?: return null + return if (config.isEnabled && (config.expirationType == ExpirationType.DELETE_AFTER_SEND || isSyncMessage)) { + config.durationSeconds * 1000L + } else null + } + // Open Groups private fun sendToOpenGroupDestination(destination: Destination, message: Message): Promise { val deferred = deferred() 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 86b856d952..7c55c2428b 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 @@ -5,6 +5,7 @@ import org.session.libsession.avatars.AvatarHelper import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.jobs.BackgroundGroupAddJob import org.session.libsession.messaging.jobs.JobQueue +import org.session.libsession.messaging.messages.ExpirationSettingsConfiguration import org.session.libsession.messaging.messages.Message import org.session.libsession.messaging.messages.control.CallMessage import org.session.libsession.messaging.messages.control.ClosedGroupControlMessage @@ -13,6 +14,7 @@ import org.session.libsession.messaging.messages.control.DataExtractionNotificat import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate import org.session.libsession.messaging.messages.control.MessageRequestResponse import org.session.libsession.messaging.messages.control.ReadReceipt +import org.session.libsession.messaging.messages.control.SyncedExpiriesMessage import org.session.libsession.messaging.messages.control.TypingIndicator import org.session.libsession.messaging.messages.control.UnsendRequest import org.session.libsession.messaging.messages.visible.Attachment @@ -58,6 +60,7 @@ internal fun MessageReceiver.isBlocked(publicKey: String): Boolean { } fun MessageReceiver.handle(message: Message, proto: SignalServiceProtos.Content, openGroupID: String?) { + updateExpirationSettingsConfigIfNeeded(message, proto, openGroupID) when (message) { is ReadReceipt -> handleReadReceipt(message) is TypingIndicator -> handleTypingIndicator(message) @@ -73,9 +76,30 @@ fun MessageReceiver.handle(message: Message, proto: SignalServiceProtos.Content, runProfileUpdate = true ) is CallMessage -> handleCallMessage(message) + is SyncedExpiriesMessage -> handleSyncedExpiriesMessage(message) } } +fun updateExpirationSettingsConfigIfNeeded(message: Message, proto: SignalServiceProtos.Content, openGroupID: String?) { + if (!proto.hasLastDisappearingMessageChangeTimestamp()) return + val storage = MessagingModuleConfiguration.shared.storage + val threadID = storage.getOrCreateThreadIdFor(message.sender!!, message.groupPublicKey, openGroupID) + if (threadID <= 0) return + val localConfig = storage.getExpirationSettingsConfiguration(threadID) + if (localConfig == null || localConfig.lastChangeTimestampMs < proto.lastDisappearingMessageChangeTimestamp) return + val durationSeconds = if (proto.hasExpirationTimer()) proto.expirationTimer else 0 + val isEnabled = durationSeconds != 0 + val type = if (proto.hasExpirationType()) proto.expirationType else null + val remoteConfig = ExpirationSettingsConfiguration( + threadID, + isEnabled, + durationSeconds, + type, + proto.lastDisappearingMessageChangeTimestamp + ) + storage.addExpirationSettingsConfiguration(remoteConfig) +} + // region Control Messages private fun MessageReceiver.handleReadReceipt(message: ReadReceipt) { val context = MessagingModuleConfiguration.shared.context @@ -87,6 +111,19 @@ private fun MessageReceiver.handleCallMessage(message: CallMessage) { WebRtcUtils.SIGNAL_QUEUE.trySend(message) } +private fun MessageReceiver.handleSyncedExpiriesMessage(message: SyncedExpiriesMessage) { + val storage = MessagingModuleConfiguration.shared.storage + val userPublicKey = storage.getUserPublicKey() ?: return + if (userPublicKey != message.sender) return + message.conversationExpiries.forEach { (syncTarget, syncedExpiries) -> + val config = storage.getExpirationSettingsConfiguration(storage.getOrCreateThreadIdFor(syncTarget)) ?: return@forEach + syncedExpiries.forEach { syncedExpiry -> + val startedAtMs = syncedExpiry.expirationTimestamp!! - config.durationSeconds * 1000 + SSKEnvironment.shared.messageExpirationManager.startAnyExpiration(startedAtMs, syncTarget) + } + } +} + private fun MessageReceiver.handleTypingIndicator(message: TypingIndicator) { when (message.kind!!) { TypingIndicator.Kind.STARTED -> showTypingIndicatorIfNeeded(message.sender!!) diff --git a/libsession/src/main/java/org/session/libsession/snode/SnodeAPI.kt b/libsession/src/main/java/org/session/libsession/snode/SnodeAPI.kt index 9a17958952..c9cad7dfdd 100644 --- a/libsession/src/main/java/org/session/libsession/snode/SnodeAPI.kt +++ b/libsession/src/main/java/org/session/libsession/snode/SnodeAPI.kt @@ -493,6 +493,62 @@ object SnodeAPI { } } + fun updateExpiry(updatedExpiryMs: Long, serverHashes: List): Promise, Long>>, Exception> { + return retryIfNeeded(maxRetryCount) { + val module = MessagingModuleConfiguration.shared + val userED25519KeyPair = module.getUserED25519KeyPair() ?: return@retryIfNeeded Promise.ofFail(Error.NoKeyPair) + val userPublicKey = module.storage.getUserPublicKey() ?: return@retryIfNeeded Promise.ofFail(Error.NoKeyPair) + val updatedExpiryMsWithNetworkOffset = updatedExpiryMs + clockOffset + getSingleTargetSnode(userPublicKey).bind { snode -> + retryIfNeeded(maxRetryCount) { + // "expire" || expiry || messages[0] || ... || messages[N] + val verificationData = + (Snode.Method.Expire.rawValue + updatedExpiryMsWithNetworkOffset + serverHashes.fold("") { a, v -> a + v }).toByteArray() + val signature = ByteArray(Sign.BYTES) + sodium.cryptoSignDetached( + signature, + verificationData, + verificationData.size.toLong(), + userED25519KeyPair.secretKey.asBytes + ) + val params = mapOf( + "pubkey" to userPublicKey, + "pubkey_ed25519" to userED25519KeyPair.publicKey.asHexString, + "expiry" to updatedExpiryMs, + "messages" to serverHashes, + "signature" to Base64.encodeBytes(signature) + ) + invoke(Snode.Method.Expire, snode, params, userPublicKey).map { rawResponse -> + val swarms = rawResponse["swarm"] as? Map ?: return@map mapOf() + val result = swarms.mapNotNull { (hexSnodePublicKey, rawJSON) -> + val json = rawJSON as? Map ?: return@mapNotNull null + val isFailed = json["failed"] as? Boolean ?: false + val statusCode = json["code"] as? String + val reason = json["reason"] as? String + hexSnodePublicKey to if (isFailed) { + Log.e("Loki", "Failed to update expiry for: $hexSnodePublicKey due to error: $reason ($statusCode).") + listOf() to 0L + } else { + val hashes = json["updated"] as List + val expiryApplied = json["expiry"] as Long + val signature = json["signature"] as String + val snodePublicKey = Key.fromHexString(hexSnodePublicKey) + // The signature looks like ( PUBKEY_HEX || RMSG[0] || ... || RMSG[N] || DMSG[0] || ... || DMSG[M] ) + val message = (userPublicKey + serverHashes.fold("") { a, v -> a + v } + hashes.fold("") { a, v -> a + v }).toByteArray() + if (sodium.cryptoSignVerifyDetached(Base64.decode(signature), message, message.size, snodePublicKey.asBytes)) { + hashes to expiryApplied + } else listOf() to 0L + } + } + return@map result.toMap() + }.fail { e -> + Log.e("Loki", "Failed to update expiry", e) + } + } + } + } + } + fun parseRawMessagesResponse(rawResponse: RawResponse, snode: Snode, publicKey: String, namespace: Int = 0): List> { val messages = rawResponse["messages"] as? List<*> return if (messages != null) { diff --git a/libsignal/protobuf/SignalService.proto b/libsignal/protobuf/SignalService.proto index 016fccaa2c..841a871db2 100644 --- a/libsignal/protobuf/SignalService.proto +++ b/libsignal/protobuf/SignalService.proto @@ -59,11 +59,26 @@ message Content { optional ExpirationType expirationType = 11; optional uint32 expirationTimer = 12; optional uint64 lastDisappearingMessageChangeTimestamp = 13; + optional SyncedExpiries syncedExpiries = 14; } -message SyncedExpiry { - required string serverHash = 1; - required uint64 expirationTimestamp = 2; +message SyncedExpiries { + + message SyncedConversationExpiries { + + message SyncedExpiry { + // @required + required string serverHash = 1; // messageHash for desktop and serverHash for mobile + // @required + required uint64 expirationTimestamp = 2; // this is only used for deleteAfterRead + } + + // @required + required string syncTarget = 1; // the conversationID those expiries are related to + repeated SyncedExpiry expiries = 2; + } + + repeated SyncedConversationExpiries conversationExpiries = 1; } message KeyPair { 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 0d0a875f71..e293dc9d6e 100644 --- a/libsignal/src/main/java/org/session/libsignal/protos/SignalServiceProtos.java +++ b/libsignal/src/main/java/org/session/libsignal/protos/SignalServiceProtos.java @@ -2498,6 +2498,20 @@ public final class SignalServiceProtos { * optional uint64 lastDisappearingMessageChangeTimestamp = 13; */ long getLastDisappearingMessageChangeTimestamp(); + + // optional .signalservice.SyncedExpiries syncedExpiries = 14; + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + boolean hasSyncedExpiries(); + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries getSyncedExpiries(); + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiriesOrBuilder getSyncedExpiriesOrBuilder(); } /** * Protobuf type {@code signalservice.Content} @@ -2675,6 +2689,19 @@ public final class SignalServiceProtos { lastDisappearingMessageChangeTimestamp_ = input.readUInt64(); break; } + case 114: { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder subBuilder = null; + if (((bitField0_ & 0x00000800) == 0x00000800)) { + subBuilder = syncedExpiries_.toBuilder(); + } + syncedExpiries_ = input.readMessage(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(syncedExpiries_); + syncedExpiries_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000800; + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -3021,6 +3048,28 @@ public final class SignalServiceProtos { return lastDisappearingMessageChangeTimestamp_; } + // optional .signalservice.SyncedExpiries syncedExpiries = 14; + public static final int SYNCEDEXPIRIES_FIELD_NUMBER = 14; + private org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries syncedExpiries_; + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public boolean hasSyncedExpiries() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries getSyncedExpiries() { + return syncedExpiries_; + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiriesOrBuilder getSyncedExpiriesOrBuilder() { + return syncedExpiries_; + } + private void initFields() { dataMessage_ = org.session.libsignal.protos.SignalServiceProtos.DataMessage.getDefaultInstance(); callMessage_ = org.session.libsignal.protos.SignalServiceProtos.CallMessage.getDefaultInstance(); @@ -3033,6 +3082,7 @@ public final class SignalServiceProtos { expirationType_ = org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType.DELETE_AFTER_SEND; expirationTimer_ = 0; lastDisappearingMessageChangeTimestamp_ = 0L; + syncedExpiries_ = org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -3087,6 +3137,12 @@ public final class SignalServiceProtos { return false; } } + if (hasSyncedExpiries()) { + if (!getSyncedExpiries().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } memoizedIsInitialized = 1; return true; } @@ -3127,6 +3183,9 @@ public final class SignalServiceProtos { if (((bitField0_ & 0x00000400) == 0x00000400)) { output.writeUInt64(13, lastDisappearingMessageChangeTimestamp_); } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + output.writeMessage(14, syncedExpiries_); + } getUnknownFields().writeTo(output); } @@ -3180,6 +3239,10 @@ public final class SignalServiceProtos { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(13, lastDisappearingMessageChangeTimestamp_); } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, syncedExpiries_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -3296,6 +3359,7 @@ public final class SignalServiceProtos { getDataExtractionNotificationFieldBuilder(); getUnsendRequestFieldBuilder(); getMessageRequestResponseFieldBuilder(); + getSyncedExpiriesFieldBuilder(); } } private static Builder create() { @@ -3358,6 +3422,12 @@ public final class SignalServiceProtos { bitField0_ = (bitField0_ & ~0x00000200); lastDisappearingMessageChangeTimestamp_ = 0L; bitField0_ = (bitField0_ & ~0x00000400); + if (syncedExpiriesBuilder_ == null) { + syncedExpiries_ = org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance(); + } else { + syncedExpiriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); return this; } @@ -3462,6 +3532,14 @@ public final class SignalServiceProtos { to_bitField0_ |= 0x00000400; } result.lastDisappearingMessageChangeTimestamp_ = lastDisappearingMessageChangeTimestamp_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000800; + } + if (syncedExpiriesBuilder_ == null) { + result.syncedExpiries_ = syncedExpiries_; + } else { + result.syncedExpiries_ = syncedExpiriesBuilder_.build(); + } result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -3511,6 +3589,9 @@ public final class SignalServiceProtos { if (other.hasLastDisappearingMessageChangeTimestamp()) { setLastDisappearingMessageChangeTimestamp(other.getLastDisappearingMessageChangeTimestamp()); } + if (other.hasSyncedExpiries()) { + mergeSyncedExpiries(other.getSyncedExpiries()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -3564,6 +3645,12 @@ public final class SignalServiceProtos { return false; } } + if (hasSyncedExpiries()) { + if (!getSyncedExpiries().isInitialized()) { + + return false; + } + } return true; } @@ -4624,6 +4711,123 @@ public final class SignalServiceProtos { return this; } + // optional .signalservice.SyncedExpiries syncedExpiries = 14; + private org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries syncedExpiries_ = org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiriesOrBuilder> syncedExpiriesBuilder_; + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public boolean hasSyncedExpiries() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries getSyncedExpiries() { + if (syncedExpiriesBuilder_ == null) { + return syncedExpiries_; + } else { + return syncedExpiriesBuilder_.getMessage(); + } + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public Builder setSyncedExpiries(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries value) { + if (syncedExpiriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + syncedExpiries_ = value; + onChanged(); + } else { + syncedExpiriesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public Builder setSyncedExpiries( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder builderForValue) { + if (syncedExpiriesBuilder_ == null) { + syncedExpiries_ = builderForValue.build(); + onChanged(); + } else { + syncedExpiriesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public Builder mergeSyncedExpiries(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries value) { + if (syncedExpiriesBuilder_ == null) { + if (((bitField0_ & 0x00000800) == 0x00000800) && + syncedExpiries_ != org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance()) { + syncedExpiries_ = + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.newBuilder(syncedExpiries_).mergeFrom(value).buildPartial(); + } else { + syncedExpiries_ = value; + } + onChanged(); + } else { + syncedExpiriesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public Builder clearSyncedExpiries() { + if (syncedExpiriesBuilder_ == null) { + syncedExpiries_ = org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance(); + onChanged(); + } else { + syncedExpiriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder getSyncedExpiriesBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getSyncedExpiriesFieldBuilder().getBuilder(); + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiriesOrBuilder getSyncedExpiriesOrBuilder() { + if (syncedExpiriesBuilder_ != null) { + return syncedExpiriesBuilder_.getMessageOrBuilder(); + } else { + return syncedExpiries_; + } + } + /** + * optional .signalservice.SyncedExpiries syncedExpiries = 14; + */ + private com.google.protobuf.SingleFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiriesOrBuilder> + getSyncedExpiriesFieldBuilder() { + if (syncedExpiriesBuilder_ == null) { + syncedExpiriesBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiriesOrBuilder>( + syncedExpiries_, + getParentForChildren(), + isClean()); + syncedExpiries_ = null; + } + return syncedExpiriesBuilder_; + } + // @@protoc_insertion_point(builder_scope:signalservice.Content) } @@ -4635,53 +4839,53 @@ public final class SignalServiceProtos { // @@protoc_insertion_point(class_scope:signalservice.Content) } - public interface SyncedExpiryOrBuilder + public interface SyncedExpiriesOrBuilder extends com.google.protobuf.MessageOrBuilder { - // required string serverHash = 1; + // repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - boolean hasServerHash(); + java.util.List + getConversationExpiriesList(); /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - java.lang.String getServerHash(); + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries getConversationExpiries(int index); /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - com.google.protobuf.ByteString - getServerHashBytes(); - - // required uint64 expirationTimestamp = 2; + int getConversationExpiriesCount(); /** - * required uint64 expirationTimestamp = 2; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - boolean hasExpirationTimestamp(); + java.util.List + getConversationExpiriesOrBuilderList(); /** - * required uint64 expirationTimestamp = 2; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - long getExpirationTimestamp(); + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiriesOrBuilder getConversationExpiriesOrBuilder( + int index); } /** - * Protobuf type {@code signalservice.SyncedExpiry} + * Protobuf type {@code signalservice.SyncedExpiries} */ - public static final class SyncedExpiry extends + public static final class SyncedExpiries extends com.google.protobuf.GeneratedMessage - implements SyncedExpiryOrBuilder { - // Use SyncedExpiry.newBuilder() to construct. - private SyncedExpiry(com.google.protobuf.GeneratedMessage.Builder builder) { + implements SyncedExpiriesOrBuilder { + // Use SyncedExpiries.newBuilder() to construct. + private SyncedExpiries(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private SyncedExpiry(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private SyncedExpiries(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - private static final SyncedExpiry defaultInstance; - public static SyncedExpiry getDefaultInstance() { + private static final SyncedExpiries defaultInstance; + public static SyncedExpiries getDefaultInstance() { return defaultInstance; } - public SyncedExpiry getDefaultInstanceForType() { + public SyncedExpiries getDefaultInstanceForType() { return defaultInstance; } @@ -4691,7 +4895,7 @@ public final class SignalServiceProtos { getUnknownFields() { return this.unknownFields; } - private SyncedExpiry( + private SyncedExpiries( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4715,13 +4919,11 @@ public final class SignalServiceProtos { break; } case 10: { - bitField0_ |= 0x00000001; - serverHash_ = input.readBytes(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - expirationTimestamp_ = input.readUInt64(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + conversationExpiries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + conversationExpiries_.add(input.readMessage(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.PARSER, extensionRegistry)); break; } } @@ -4732,113 +4934,1638 @@ public final class SignalServiceProtos { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + conversationExpiries_ = java.util.Collections.unmodifiableList(conversationExpiries_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiry_descriptor; + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiry_fieldAccessorTable + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry.Builder.class); + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder.class); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SyncedExpiry parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public SyncedExpiries parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SyncedExpiry(input, extensionRegistry); + return new SyncedExpiries(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } - private int bitField0_; - // required string serverHash = 1; - public static final int SERVERHASH_FIELD_NUMBER = 1; - private java.lang.Object serverHash_; - /** - * required string serverHash = 1; - */ - public boolean hasServerHash() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public interface SyncedConversationExpiriesOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string syncTarget = 1; + /** + * required string syncTarget = 1; + * + *
+       * @required
+       * 
+ */ + boolean hasSyncTarget(); + /** + * required string syncTarget = 1; + * + *
+       * @required
+       * 
+ */ + java.lang.String getSyncTarget(); + /** + * required string syncTarget = 1; + * + *
+       * @required
+       * 
+ */ + com.google.protobuf.ByteString + getSyncTargetBytes(); + + // repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + java.util.List + getExpiriesList(); + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry getExpiries(int index); + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + int getExpiriesCount(); + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + java.util.List + getExpiriesOrBuilderList(); + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiryOrBuilder getExpiriesOrBuilder( + int index); } /** - * required string serverHash = 1; + * Protobuf type {@code signalservice.SyncedExpiries.SyncedConversationExpiries} */ - public java.lang.String getServerHash() { - java.lang.Object ref = serverHash_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - serverHash_ = s; + public static final class SyncedConversationExpiries extends + com.google.protobuf.GeneratedMessage + implements SyncedConversationExpiriesOrBuilder { + // Use SyncedConversationExpiries.newBuilder() to construct. + private SyncedConversationExpiries(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private SyncedConversationExpiries(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final SyncedConversationExpiries defaultInstance; + public static SyncedConversationExpiries getDefaultInstance() { + return defaultInstance; + } + + public SyncedConversationExpiries getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SyncedConversationExpiries( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + syncTarget_ = input.readBytes(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + expiries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + expiries_.add(input.readMessage(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + expiries_ = java.util.Collections.unmodifiableList(expiries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } - return s; } - } - /** - * required string serverHash = 1; - */ - public com.google.protobuf.ByteString - getServerHashBytes() { - java.lang.Object ref = serverHash_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serverHash_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_descriptor; } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public SyncedConversationExpiries parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SyncedConversationExpiries(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface SyncedExpiryOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string serverHash = 1; + /** + * required string serverHash = 1; + * + *
+         * @required
+         * 
+ */ + boolean hasServerHash(); + /** + * required string serverHash = 1; + * + *
+         * @required
+         * 
+ */ + java.lang.String getServerHash(); + /** + * required string serverHash = 1; + * + *
+         * @required
+         * 
+ */ + com.google.protobuf.ByteString + getServerHashBytes(); + + // required uint64 expirationTimestamp = 2; + /** + * required uint64 expirationTimestamp = 2; + * + *
+         * @required
+         * 
+ */ + boolean hasExpirationTimestamp(); + /** + * required uint64 expirationTimestamp = 2; + * + *
+         * @required
+         * 
+ */ + long getExpirationTimestamp(); + } + /** + * Protobuf type {@code signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry} + */ + public static final class SyncedExpiry extends + com.google.protobuf.GeneratedMessage + implements SyncedExpiryOrBuilder { + // Use SyncedExpiry.newBuilder() to construct. + private SyncedExpiry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private SyncedExpiry(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final SyncedExpiry defaultInstance; + public static SyncedExpiry getDefaultInstance() { + return defaultInstance; + } + + public SyncedExpiry getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SyncedExpiry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + serverHash_ = input.readBytes(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + expirationTimestamp_ = input.readUInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public SyncedExpiry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SyncedExpiry(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string serverHash = 1; + public static final int SERVERHASH_FIELD_NUMBER = 1; + private java.lang.Object serverHash_; + /** + * required string serverHash = 1; + * + *
+         * @required
+         * 
+ */ + public boolean hasServerHash() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string serverHash = 1; + * + *
+         * @required
+         * 
+ */ + public java.lang.String getServerHash() { + java.lang.Object ref = serverHash_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + serverHash_ = s; + } + return s; + } + } + /** + * required string serverHash = 1; + * + *
+         * @required
+         * 
+ */ + public com.google.protobuf.ByteString + getServerHashBytes() { + java.lang.Object ref = serverHash_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serverHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required uint64 expirationTimestamp = 2; + public static final int EXPIRATIONTIMESTAMP_FIELD_NUMBER = 2; + private long expirationTimestamp_; + /** + * required uint64 expirationTimestamp = 2; + * + *
+         * @required
+         * 
+ */ + public boolean hasExpirationTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint64 expirationTimestamp = 2; + * + *
+         * @required
+         * 
+ */ + public long getExpirationTimestamp() { + return expirationTimestamp_; + } + + private void initFields() { + serverHash_ = ""; + expirationTimestamp_ = 0L; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasServerHash()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasExpirationTimestamp()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getServerHashBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt64(2, expirationTimestamp_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getServerHashBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, expirationTimestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder.class); + } + + // Construct using org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + serverHash_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + expirationTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_descriptor; + } + + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry getDefaultInstanceForType() { + return org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.getDefaultInstance(); + } + + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry build() { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry buildPartial() { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry result = new org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.serverHash_ = serverHash_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.expirationTimestamp_ = expirationTimestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry) { + return mergeFrom((org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry other) { + if (other == org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.getDefaultInstance()) return this; + if (other.hasServerHash()) { + bitField0_ |= 0x00000001; + serverHash_ = other.serverHash_; + onChanged(); + } + if (other.hasExpirationTimestamp()) { + setExpirationTimestamp(other.getExpirationTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasServerHash()) { + + return false; + } + if (!hasExpirationTimestamp()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string serverHash = 1; + private java.lang.Object serverHash_ = ""; + /** + * required string serverHash = 1; + * + *
+           * @required
+           * 
+ */ + public boolean hasServerHash() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string serverHash = 1; + * + *
+           * @required
+           * 
+ */ + public java.lang.String getServerHash() { + java.lang.Object ref = serverHash_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + serverHash_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string serverHash = 1; + * + *
+           * @required
+           * 
+ */ + public com.google.protobuf.ByteString + getServerHashBytes() { + java.lang.Object ref = serverHash_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serverHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string serverHash = 1; + * + *
+           * @required
+           * 
+ */ + public Builder setServerHash( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + serverHash_ = value; + onChanged(); + return this; + } + /** + * required string serverHash = 1; + * + *
+           * @required
+           * 
+ */ + public Builder clearServerHash() { + bitField0_ = (bitField0_ & ~0x00000001); + serverHash_ = getDefaultInstance().getServerHash(); + onChanged(); + return this; + } + /** + * required string serverHash = 1; + * + *
+           * @required
+           * 
+ */ + public Builder setServerHashBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + serverHash_ = value; + onChanged(); + return this; + } + + // required uint64 expirationTimestamp = 2; + private long expirationTimestamp_ ; + /** + * required uint64 expirationTimestamp = 2; + * + *
+           * @required
+           * 
+ */ + public boolean hasExpirationTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint64 expirationTimestamp = 2; + * + *
+           * @required
+           * 
+ */ + public long getExpirationTimestamp() { + return expirationTimestamp_; + } + /** + * required uint64 expirationTimestamp = 2; + * + *
+           * @required
+           * 
+ */ + public Builder setExpirationTimestamp(long value) { + bitField0_ |= 0x00000002; + expirationTimestamp_ = value; + onChanged(); + return this; + } + /** + * required uint64 expirationTimestamp = 2; + * + *
+           * @required
+           * 
+ */ + public Builder clearExpirationTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + expirationTimestamp_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry) + } + + static { + defaultInstance = new SyncedExpiry(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry) + } + + private int bitField0_; + // required string syncTarget = 1; + public static final int SYNCTARGET_FIELD_NUMBER = 1; + private java.lang.Object syncTarget_; + /** + * required string syncTarget = 1; + * + *
+       * @required
+       * 
+ */ + public boolean hasSyncTarget() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string syncTarget = 1; + * + *
+       * @required
+       * 
+ */ + public java.lang.String getSyncTarget() { + java.lang.Object ref = syncTarget_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + syncTarget_ = s; + } + return s; + } + } + /** + * required string syncTarget = 1; + * + *
+       * @required
+       * 
+ */ + public com.google.protobuf.ByteString + getSyncTargetBytes() { + java.lang.Object ref = syncTarget_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + syncTarget_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + public static final int EXPIRIES_FIELD_NUMBER = 2; + private java.util.List expiries_; + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public java.util.List getExpiriesList() { + return expiries_; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public java.util.List + getExpiriesOrBuilderList() { + return expiries_; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public int getExpiriesCount() { + return expiries_.size(); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry getExpiries(int index) { + return expiries_.get(index); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiryOrBuilder getExpiriesOrBuilder( + int index) { + return expiries_.get(index); + } + + private void initFields() { + syncTarget_ = ""; + expiries_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSyncTarget()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getExpiriesCount(); i++) { + if (!getExpiries(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getSyncTargetBytes()); + } + for (int i = 0; i < expiries_.size(); i++) { + output.writeMessage(2, expiries_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getSyncTargetBytes()); + } + for (int i = 0; i < expiries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, expiries_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code signalservice.SyncedExpiries.SyncedConversationExpiries} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiriesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder.class); + } + + // Construct using org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getExpiriesFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + syncTarget_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (expiriesBuilder_ == null) { + expiries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + expiriesBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_descriptor; + } + + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries getDefaultInstanceForType() { + return org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.getDefaultInstance(); + } + + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries build() { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries buildPartial() { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries result = new org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.syncTarget_ = syncTarget_; + if (expiriesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + expiries_ = java.util.Collections.unmodifiableList(expiries_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.expiries_ = expiries_; + } else { + result.expiries_ = expiriesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries) { + return mergeFrom((org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries other) { + if (other == org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.getDefaultInstance()) return this; + if (other.hasSyncTarget()) { + bitField0_ |= 0x00000001; + syncTarget_ = other.syncTarget_; + onChanged(); + } + if (expiriesBuilder_ == null) { + if (!other.expiries_.isEmpty()) { + if (expiries_.isEmpty()) { + expiries_ = other.expiries_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureExpiriesIsMutable(); + expiries_.addAll(other.expiries_); + } + onChanged(); + } + } else { + if (!other.expiries_.isEmpty()) { + if (expiriesBuilder_.isEmpty()) { + expiriesBuilder_.dispose(); + expiriesBuilder_ = null; + expiries_ = other.expiries_; + bitField0_ = (bitField0_ & ~0x00000002); + expiriesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getExpiriesFieldBuilder() : null; + } else { + expiriesBuilder_.addAllMessages(other.expiries_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasSyncTarget()) { + + return false; + } + for (int i = 0; i < getExpiriesCount(); i++) { + if (!getExpiries(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string syncTarget = 1; + private java.lang.Object syncTarget_ = ""; + /** + * required string syncTarget = 1; + * + *
+         * @required
+         * 
+ */ + public boolean hasSyncTarget() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string syncTarget = 1; + * + *
+         * @required
+         * 
+ */ + public java.lang.String getSyncTarget() { + java.lang.Object ref = syncTarget_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + syncTarget_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string syncTarget = 1; + * + *
+         * @required
+         * 
+ */ + public com.google.protobuf.ByteString + getSyncTargetBytes() { + java.lang.Object ref = syncTarget_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + syncTarget_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string syncTarget = 1; + * + *
+         * @required
+         * 
+ */ + public Builder setSyncTarget( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + syncTarget_ = value; + onChanged(); + return this; + } + /** + * required string syncTarget = 1; + * + *
+         * @required
+         * 
+ */ + public Builder clearSyncTarget() { + bitField0_ = (bitField0_ & ~0x00000001); + syncTarget_ = getDefaultInstance().getSyncTarget(); + onChanged(); + return this; + } + /** + * required string syncTarget = 1; + * + *
+         * @required
+         * 
+ */ + public Builder setSyncTargetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + syncTarget_ = value; + onChanged(); + return this; + } + + // repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + private java.util.List expiries_ = + java.util.Collections.emptyList(); + private void ensureExpiriesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + expiries_ = new java.util.ArrayList(expiries_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiryOrBuilder> expiriesBuilder_; + + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public java.util.List getExpiriesList() { + if (expiriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(expiries_); + } else { + return expiriesBuilder_.getMessageList(); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public int getExpiriesCount() { + if (expiriesBuilder_ == null) { + return expiries_.size(); + } else { + return expiriesBuilder_.getCount(); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry getExpiries(int index) { + if (expiriesBuilder_ == null) { + return expiries_.get(index); + } else { + return expiriesBuilder_.getMessage(index); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder setExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry value) { + if (expiriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExpiriesIsMutable(); + expiries_.set(index, value); + onChanged(); + } else { + expiriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder setExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder builderForValue) { + if (expiriesBuilder_ == null) { + ensureExpiriesIsMutable(); + expiries_.set(index, builderForValue.build()); + onChanged(); + } else { + expiriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder addExpiries(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry value) { + if (expiriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExpiriesIsMutable(); + expiries_.add(value); + onChanged(); + } else { + expiriesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder addExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry value) { + if (expiriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExpiriesIsMutable(); + expiries_.add(index, value); + onChanged(); + } else { + expiriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder addExpiries( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder builderForValue) { + if (expiriesBuilder_ == null) { + ensureExpiriesIsMutable(); + expiries_.add(builderForValue.build()); + onChanged(); + } else { + expiriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder addExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder builderForValue) { + if (expiriesBuilder_ == null) { + ensureExpiriesIsMutable(); + expiries_.add(index, builderForValue.build()); + onChanged(); + } else { + expiriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder addAllExpiries( + java.lang.Iterable values) { + if (expiriesBuilder_ == null) { + ensureExpiriesIsMutable(); + super.addAll(values, expiries_); + onChanged(); + } else { + expiriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder clearExpiries() { + if (expiriesBuilder_ == null) { + expiries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + expiriesBuilder_.clear(); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public Builder removeExpiries(int index) { + if (expiriesBuilder_ == null) { + ensureExpiriesIsMutable(); + expiries_.remove(index); + onChanged(); + } else { + expiriesBuilder_.remove(index); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder getExpiriesBuilder( + int index) { + return getExpiriesFieldBuilder().getBuilder(index); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiryOrBuilder getExpiriesOrBuilder( + int index) { + if (expiriesBuilder_ == null) { + return expiries_.get(index); } else { + return expiriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public java.util.List + getExpiriesOrBuilderList() { + if (expiriesBuilder_ != null) { + return expiriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(expiries_); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder addExpiriesBuilder() { + return getExpiriesFieldBuilder().addBuilder( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.getDefaultInstance()); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder addExpiriesBuilder( + int index) { + return getExpiriesFieldBuilder().addBuilder( + index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.getDefaultInstance()); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry expiries = 2; + */ + public java.util.List + getExpiriesBuilderList() { + return getExpiriesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiryOrBuilder> + getExpiriesFieldBuilder() { + if (expiriesBuilder_ == null) { + expiriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiry.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.SyncedExpiryOrBuilder>( + expiries_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + expiries_ = null; + } + return expiriesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:signalservice.SyncedExpiries.SyncedConversationExpiries) + } + + static { + defaultInstance = new SyncedConversationExpiries(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:signalservice.SyncedExpiries.SyncedConversationExpiries) } - // required uint64 expirationTimestamp = 2; - public static final int EXPIRATIONTIMESTAMP_FIELD_NUMBER = 2; - private long expirationTimestamp_; + // repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + public static final int CONVERSATIONEXPIRIES_FIELD_NUMBER = 1; + private java.util.List conversationExpiries_; /** - * required uint64 expirationTimestamp = 2; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - public boolean hasExpirationTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public java.util.List getConversationExpiriesList() { + return conversationExpiries_; } /** - * required uint64 expirationTimestamp = 2; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - public long getExpirationTimestamp() { - return expirationTimestamp_; + public java.util.List + getConversationExpiriesOrBuilderList() { + return conversationExpiries_; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public int getConversationExpiriesCount() { + return conversationExpiries_.size(); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries getConversationExpiries(int index) { + return conversationExpiries_.get(index); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiriesOrBuilder getConversationExpiriesOrBuilder( + int index) { + return conversationExpiries_.get(index); } private void initFields() { - serverHash_ = ""; - expirationTimestamp_ = 0L; + conversationExpiries_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - if (!hasServerHash()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasExpirationTimestamp()) { - memoizedIsInitialized = 0; - return false; + for (int i = 0; i < getConversationExpiriesCount(); i++) { + if (!getConversationExpiries(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } memoizedIsInitialized = 1; return true; @@ -4847,11 +6574,8 @@ public final class SignalServiceProtos { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getServerHashBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeUInt64(2, expirationTimestamp_); + for (int i = 0; i < conversationExpiries_.size(); i++) { + output.writeMessage(1, conversationExpiries_.get(i)); } getUnknownFields().writeTo(output); } @@ -4862,13 +6586,9 @@ public final class SignalServiceProtos { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + for (int i = 0; i < conversationExpiries_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getServerHashBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, expirationTimestamp_); + .computeMessageSize(1, conversationExpiries_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -4882,53 +6602,53 @@ public final class SignalServiceProtos { return super.writeReplace(); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom( + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom( + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom(byte[] data) + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom( + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom(java.io.InputStream input) + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom( + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseDelimitedFrom(java.io.InputStream input) + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseDelimitedFrom( + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom( + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parseFrom( + public static org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4937,7 +6657,7 @@ public final class SignalServiceProtos { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry prototype) { + public static Builder newBuilder(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -4949,24 +6669,24 @@ public final class SignalServiceProtos { return builder; } /** - * Protobuf type {@code signalservice.SyncedExpiry} + * Protobuf type {@code signalservice.SyncedExpiries} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements org.session.libsignal.protos.SignalServiceProtos.SyncedExpiryOrBuilder { + implements org.session.libsignal.protos.SignalServiceProtos.SyncedExpiriesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiry_descriptor; + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiry_fieldAccessorTable + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry.Builder.class); + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.class, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.Builder.class); } - // Construct using org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry.newBuilder() + // Construct using org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4978,6 +6698,7 @@ public final class SignalServiceProtos { } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getConversationExpiriesFieldBuilder(); } } private static Builder create() { @@ -4986,10 +6707,12 @@ public final class SignalServiceProtos { public Builder clear() { super.clear(); - serverHash_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - expirationTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); + if (conversationExpiriesBuilder_ == null) { + conversationExpiries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + conversationExpiriesBuilder_.clear(); + } return this; } @@ -4999,69 +6722,84 @@ public final class SignalServiceProtos { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiry_descriptor; + return org.session.libsignal.protos.SignalServiceProtos.internal_static_signalservice_SyncedExpiries_descriptor; } - public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry getDefaultInstanceForType() { - return org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry.getDefaultInstance(); + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries getDefaultInstanceForType() { + return org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance(); } - public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry build() { - org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry result = buildPartial(); + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries build() { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry buildPartial() { - org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry result = new org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry(this); + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries buildPartial() { + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries result = new org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; + if (conversationExpiriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + conversationExpiries_ = java.util.Collections.unmodifiableList(conversationExpiries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conversationExpiries_ = conversationExpiries_; + } else { + result.conversationExpiries_ = conversationExpiriesBuilder_.build(); } - result.serverHash_ = serverHash_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.expirationTimestamp_ = expirationTimestamp_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry) { - return mergeFrom((org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry)other); + if (other instanceof org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries) { + return mergeFrom((org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry other) { - if (other == org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry.getDefaultInstance()) return this; - if (other.hasServerHash()) { - bitField0_ |= 0x00000001; - serverHash_ = other.serverHash_; - onChanged(); - } - if (other.hasExpirationTimestamp()) { - setExpirationTimestamp(other.getExpirationTimestamp()); + public Builder mergeFrom(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries other) { + if (other == org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.getDefaultInstance()) return this; + if (conversationExpiriesBuilder_ == null) { + if (!other.conversationExpiries_.isEmpty()) { + if (conversationExpiries_.isEmpty()) { + conversationExpiries_ = other.conversationExpiries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConversationExpiriesIsMutable(); + conversationExpiries_.addAll(other.conversationExpiries_); + } + onChanged(); + } + } else { + if (!other.conversationExpiries_.isEmpty()) { + if (conversationExpiriesBuilder_.isEmpty()) { + conversationExpiriesBuilder_.dispose(); + conversationExpiriesBuilder_ = null; + conversationExpiries_ = other.conversationExpiries_; + bitField0_ = (bitField0_ & ~0x00000001); + conversationExpiriesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getConversationExpiriesFieldBuilder() : null; + } else { + conversationExpiriesBuilder_.addAllMessages(other.conversationExpiries_); + } + } } this.mergeUnknownFields(other.getUnknownFields()); return this; } public final boolean isInitialized() { - if (!hasServerHash()) { - - return false; - } - if (!hasExpirationTimestamp()) { - - return false; + for (int i = 0; i < getConversationExpiriesCount(); i++) { + if (!getConversationExpiries(i).isInitialized()) { + + return false; + } } return true; } @@ -5070,11 +6808,11 @@ public final class SignalServiceProtos { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry parsedMessage = null; + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.session.libsignal.protos.SignalServiceProtos.SyncedExpiry) e.getUnfinishedMessage(); + parsedMessage = (org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -5085,122 +6823,255 @@ public final class SignalServiceProtos { } private int bitField0_; - // required string serverHash = 1; - private java.lang.Object serverHash_ = ""; - /** - * required string serverHash = 1; - */ - public boolean hasServerHash() { - return ((bitField0_ & 0x00000001) == 0x00000001); + // repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + private java.util.List conversationExpiries_ = + java.util.Collections.emptyList(); + private void ensureConversationExpiriesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + conversationExpiries_ = new java.util.ArrayList(conversationExpiries_); + bitField0_ |= 0x00000001; + } } + + private com.google.protobuf.RepeatedFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiriesOrBuilder> conversationExpiriesBuilder_; + /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - public java.lang.String getServerHash() { - java.lang.Object ref = serverHash_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - serverHash_ = s; - return s; + public java.util.List getConversationExpiriesList() { + if (conversationExpiriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(conversationExpiries_); } else { - return (java.lang.String) ref; + return conversationExpiriesBuilder_.getMessageList(); } } /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - public com.google.protobuf.ByteString - getServerHashBytes() { - java.lang.Object ref = serverHash_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serverHash_ = b; - return b; + public int getConversationExpiriesCount() { + if (conversationExpiriesBuilder_ == null) { + return conversationExpiries_.size(); } else { - return (com.google.protobuf.ByteString) ref; + return conversationExpiriesBuilder_.getCount(); } } /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - public Builder setServerHash( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - serverHash_ = value; - onChanged(); + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries getConversationExpiries(int index) { + if (conversationExpiriesBuilder_ == null) { + return conversationExpiries_.get(index); + } else { + return conversationExpiriesBuilder_.getMessage(index); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public Builder setConversationExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries value) { + if (conversationExpiriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationExpiriesIsMutable(); + conversationExpiries_.set(index, value); + onChanged(); + } else { + conversationExpiriesBuilder_.setMessage(index, value); + } return this; } /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - public Builder clearServerHash() { - bitField0_ = (bitField0_ & ~0x00000001); - serverHash_ = getDefaultInstance().getServerHash(); - onChanged(); + public Builder setConversationExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder builderForValue) { + if (conversationExpiriesBuilder_ == null) { + ensureConversationExpiriesIsMutable(); + conversationExpiries_.set(index, builderForValue.build()); + onChanged(); + } else { + conversationExpiriesBuilder_.setMessage(index, builderForValue.build()); + } return this; } /** - * required string serverHash = 1; + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; */ - public Builder setServerHashBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - serverHash_ = value; - onChanged(); + public Builder addConversationExpiries(org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries value) { + if (conversationExpiriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationExpiriesIsMutable(); + conversationExpiries_.add(value); + onChanged(); + } else { + conversationExpiriesBuilder_.addMessage(value); + } return this; } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public Builder addConversationExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries value) { + if (conversationExpiriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationExpiriesIsMutable(); + conversationExpiries_.add(index, value); + onChanged(); + } else { + conversationExpiriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public Builder addConversationExpiries( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder builderForValue) { + if (conversationExpiriesBuilder_ == null) { + ensureConversationExpiriesIsMutable(); + conversationExpiries_.add(builderForValue.build()); + onChanged(); + } else { + conversationExpiriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public Builder addConversationExpiries( + int index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder builderForValue) { + if (conversationExpiriesBuilder_ == null) { + ensureConversationExpiriesIsMutable(); + conversationExpiries_.add(index, builderForValue.build()); + onChanged(); + } else { + conversationExpiriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public Builder addAllConversationExpiries( + java.lang.Iterable values) { + if (conversationExpiriesBuilder_ == null) { + ensureConversationExpiriesIsMutable(); + super.addAll(values, conversationExpiries_); + onChanged(); + } else { + conversationExpiriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public Builder clearConversationExpiries() { + if (conversationExpiriesBuilder_ == null) { + conversationExpiries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conversationExpiriesBuilder_.clear(); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public Builder removeConversationExpiries(int index) { + if (conversationExpiriesBuilder_ == null) { + ensureConversationExpiriesIsMutable(); + conversationExpiries_.remove(index); + onChanged(); + } else { + conversationExpiriesBuilder_.remove(index); + } + return this; + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder getConversationExpiriesBuilder( + int index) { + return getConversationExpiriesFieldBuilder().getBuilder(index); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiriesOrBuilder getConversationExpiriesOrBuilder( + int index) { + if (conversationExpiriesBuilder_ == null) { + return conversationExpiries_.get(index); } else { + return conversationExpiriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public java.util.List + getConversationExpiriesOrBuilderList() { + if (conversationExpiriesBuilder_ != null) { + return conversationExpiriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conversationExpiries_); + } + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder addConversationExpiriesBuilder() { + return getConversationExpiriesFieldBuilder().addBuilder( + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.getDefaultInstance()); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder addConversationExpiriesBuilder( + int index) { + return getConversationExpiriesFieldBuilder().addBuilder( + index, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.getDefaultInstance()); + } + /** + * repeated .signalservice.SyncedExpiries.SyncedConversationExpiries conversationExpiries = 1; + */ + public java.util.List + getConversationExpiriesBuilderList() { + return getConversationExpiriesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiriesOrBuilder> + getConversationExpiriesFieldBuilder() { + if (conversationExpiriesBuilder_ == null) { + conversationExpiriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiries.Builder, org.session.libsignal.protos.SignalServiceProtos.SyncedExpiries.SyncedConversationExpiriesOrBuilder>( + conversationExpiries_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + conversationExpiries_ = null; + } + return conversationExpiriesBuilder_; + } - // required uint64 expirationTimestamp = 2; - private long expirationTimestamp_ ; - /** - * required uint64 expirationTimestamp = 2; - */ - public boolean hasExpirationTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required uint64 expirationTimestamp = 2; - */ - public long getExpirationTimestamp() { - return expirationTimestamp_; - } - /** - * required uint64 expirationTimestamp = 2; - */ - public Builder setExpirationTimestamp(long value) { - bitField0_ |= 0x00000002; - expirationTimestamp_ = value; - onChanged(); - return this; - } - /** - * required uint64 expirationTimestamp = 2; - */ - public Builder clearExpirationTimestamp() { - bitField0_ = (bitField0_ & ~0x00000002); - expirationTimestamp_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:signalservice.SyncedExpiry) + // @@protoc_insertion_point(builder_scope:signalservice.SyncedExpiries) } static { - defaultInstance = new SyncedExpiry(true); + defaultInstance = new SyncedExpiries(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:signalservice.SyncedExpiry) + // @@protoc_insertion_point(class_scope:signalservice.SyncedExpiries) } public interface KeyPairOrBuilder @@ -26628,10 +28499,20 @@ public final class SignalServiceProtos { com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_signalservice_Content_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor - internal_static_signalservice_SyncedExpiry_descriptor; + internal_static_signalservice_SyncedExpiries_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_signalservice_SyncedExpiry_fieldAccessorTable; + internal_static_signalservice_SyncedExpiries_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_signalservice_KeyPair_descriptor; private static @@ -26746,7 +28627,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\"\255\005\n\007Content\022/\n\013" + + "mp\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\"\344\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" + @@ -26762,97 +28643,104 @@ public final class SignalServiceProtos { "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_SEND\020\001\022\025\n\021DELETE_AFTER_READ\020\002\"?\n\014Sync" + - "edExpiry\022\022\n\nserverHash\030\001 \002(\t\022\033\n\023expirati" + - "onTimestamp\030\002 \002(\004\"0\n\007KeyPair\022\021\n\tpublicKe", - "y\030\001 \002(\014\022\022\n\nprivateKey\030\002 \002(\014\"\226\001\n\032DataExtr" + - "actionNotification\022<\n\004type\030\001 \002(\0162..signa" + - "lservice.DataExtractionNotification.Type" + - "\022\021\n\ttimestamp\030\002 \001(\004\"\'\n\004Type\022\016\n\nSCREENSHO" + - "T\020\001\022\017\n\013MEDIA_SAVED\020\002\"\361\r\n\013DataMessage\022\014\n\004" + - "body\030\001 \001(\t\0225\n\013attachments\030\002 \003(\0132 .signal" + - "service.AttachmentPointer\022*\n\005group\030\003 \001(\013" + - "2\033.signalservice.GroupContext\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.DataMessage.Quote\0223\n\007pre" + - "view\030\n \003(\0132\".signalservice.DataMessage.P" + - "review\0225\n\010reaction\030\013 \001(\0132#.signalservice" + - ".DataMessage.Reaction\0227\n\007profile\030e \001(\0132&" + - ".signalservice.DataMessage.LokiProfile\022K" + - "\n\023openGroupInvitation\030f \001(\0132..signalserv" + - "ice.DataMessage.OpenGroupInvitation\022W\n\031c" + - "losedGroupControlMessage\030h \001(\01324.signals" + - "ervice.DataMessage.ClosedGroupControlMes" + - "sage\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\013" + - "attachments\030\004 \003(\01321.signalservice.DataMe" + - "ssage.Quote.QuotedAttachment\032\231\001\n\020QuotedA" + - "ttachment\022\023\n\013contentType\030\001 \001(\t\022\020\n\010fileNa" + - "me\030\002 \001(\t\0223\n\tthumbnail\030\003 \001(\0132 .signalserv" + - "ice.AttachmentPointer\022\r\n\005flags\030\004 \001(\r\"\032\n\005" + - "Flags\022\021\n\rVOICE_MESSAGE\020\001\032V\n\007Preview\022\013\n\003u" + - "rl\030\001 \002(\t\022\r\n\005title\030\002 \001(\t\022/\n\005image\030\003 \001(\0132 " + - ".signalservice.AttachmentPointer\032:\n\013Loki" + - "Profile\022\023\n\013displayName\030\001 \001(\t\022\026\n\016profileP", - "icture\030\002 \001(\t\0320\n\023OpenGroupInvitation\022\013\n\003u" + - "rl\030\001 \002(\t\022\014\n\004name\030\003 \002(\t\032\374\003\n\031ClosedGroupCo" + - "ntrolMessage\022G\n\004type\030\001 \002(\01629.signalservi" + - "ce.DataMessage.ClosedGroupControlMessage" + - ".Type\022\021\n\tpublicKey\030\002 \001(\014\022\014\n\004name\030\003 \001(\t\0221" + - "\n\021encryptionKeyPair\030\004 \001(\0132\026.signalservic" + - "e.KeyPair\022\017\n\007members\030\005 \003(\014\022\016\n\006admins\030\006 \003" + - "(\014\022U\n\010wrappers\030\007 \003(\0132C.signalservice.Dat" + - "aMessage.ClosedGroupControlMessage.KeyPa" + - "irWrapper\022\027\n\017expirationTimer\030\010 \001(\r\032=\n\016Ke", - "yPairWrapper\022\021\n\tpublicKey\030\001 \002(\014\022\030\n\020encry" + - "ptedKeyPair\030\002 \002(\014\"r\n\004Type\022\007\n\003NEW\020\001\022\027\n\023EN" + - "CRYPTION_KEY_PAIR\020\003\022\017\n\013NAME_CHANGE\020\004\022\021\n\r" + - "MEMBERS_ADDED\020\005\022\023\n\017MEMBERS_REMOVED\020\006\022\017\n\013" + - "MEMBER_LEFT\020\007\032\222\001\n\010Reaction\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.DataMessage.Reacti" + - "on.Action\"\037\n\006Action\022\t\n\005REACT\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.signals", - "ervice.CallMessage.Type\022\014\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\tPRE_OFFER\020\006\022\t\n\005" + - "OFFER\020\001\022\n\n\006ANSWER\020\002\022\026\n\022PROVISIONAL_ANSWE" + - "R\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.ConfigurationMessag" + - "e.ClosedGroup\022\022\n\nopenGroups\030\002 \003(\t\022\023\n\013dis" + - "playName\030\003 \001(\t\022\026\n\016profilePicture\030\004 \001(\t\022\022" + - "\n\nprofileKey\030\005 \001(\014\022=\n\010contacts\030\006 \003(\0132+.s", - "ignalservice.ConfigurationMessage.Contac" + - "t\032\233\001\n\013ClosedGroup\022\021\n\tpublicKey\030\001 \001(\014\022\014\n\004" + - "name\030\002 \001(\t\0221\n\021encryptionKeyPair\030\003 \001(\0132\026." + - "signalservice.KeyPair\022\017\n\007members\030\004 \003(\014\022\016" + - "\n\006admins\030\005 \003(\014\022\027\n\017expirationTimer\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(\t\022\022\n\nprofileK" + - "ey\030\004 \001(\014\022\022\n\nisApproved\030\005 \001(\010\022\021\n\tisBlocke" + - "d\030\006 \001(\010\022\024\n\014didApproveMe\030\007 \001(\010\",\n\026Message" + - "RequestResponse\022\022\n\nisApproved\030\001 \002(\010\"u\n\016R", - "eceiptMessage\0220\n\004type\030\001 \002(\0162\".signalserv" + - "ice.ReceiptMessage.Type\022\021\n\ttimestamp\030\002 \003" + - "(\004\"\036\n\004Type\022\014\n\010DELIVERY\020\000\022\010\n\004READ\020\001\"\354\001\n\021A" + - "ttachmentPointer\022\n\n\002id\030\001 \002(\006\022\023\n\013contentT" + - "ype\030\002 \001(\t\022\013\n\003key\030\003 \001(\014\022\014\n\004size\030\004 \001(\r\022\021\n\t" + - "thumbnail\030\005 \001(\014\022\016\n\006digest\030\006 \001(\014\022\020\n\010fileN" + - "ame\030\007 \001(\t\022\r\n\005flags\030\010 \001(\r\022\r\n\005width\030\t \001(\r\022" + - "\016\n\006height\030\n \001(\r\022\017\n\007caption\030\013 \001(\t\022\013\n\003url\030" + - "e \001(\t\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\"\365\001\n\014Gr" + - "oupContext\022\n\n\002id\030\001 \001(\014\022.\n\004type\030\002 \001(\0162 .s", - "ignalservice.GroupContext.Type\022\014\n\004name\030\003" + - " \001(\t\022\017\n\007members\030\004 \003(\t\0220\n\006avatar\030\005 \001(\0132 ." + - "signalservice.AttachmentPointer\022\016\n\006admin" + - "s\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\014REQUEST_INFO\020" + - "\004B3\n\034org.session.libsignal.protosB\023Signa" + - "lServiceProtos" + "mp\030\r \001(\004\0225\n\016syncedExpiries\030\016 \001(\0132\035.signa" + + "lservice.SyncedExpiries\">\n\016ExpirationTyp" + + "e\022\025\n\021DELETE_AFTER_SEND\020\001\022\025\n\021DELETE_AFTER" + + "_READ\020\002\"\265\002\n\016SyncedExpiries\022V\n\024conversati", + "onExpiries\030\001 \003(\01328.signalservice.SyncedE" + + "xpiries.SyncedConversationExpiries\032\312\001\n\032S" + + "yncedConversationExpiries\022\022\n\nsyncTarget\030" + + "\001 \002(\t\022W\n\010expiries\030\002 \003(\0132E.signalservice." + + "SyncedExpiries.SyncedConversationExpirie" + + "s.SyncedExpiry\032?\n\014SyncedExpiry\022\022\n\nserver" + + "Hash\030\001 \002(\t\022\033\n\023expirationTimestamp\030\002 \002(\004\"" + + "0\n\007KeyPair\022\021\n\tpublicKey\030\001 \002(\014\022\022\n\nprivate" + + "Key\030\002 \002(\014\"\226\001\n\032DataExtractionNotification" + + "\022<\n\004type\030\001 \002(\0162..signalservice.DataExtra", + "ctionNotification.Type\022\021\n\ttimestamp\030\002 \001(" + + "\004\"\'\n\004Type\022\016\n\nSCREENSHOT\020\001\022\017\n\013MEDIA_SAVED" + + "\020\002\"\361\r\n\013DataMessage\022\014\n\004body\030\001 \001(\t\0225\n\013atta" + + "chments\030\002 \003(\0132 .signalservice.Attachment" + + "Pointer\022*\n\005group\030\003 \001(\0132\033.signalservice.G" + + "roupContext\022\r\n\005flags\030\004 \001(\r\022\023\n\013expireTime" + + "r\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.Da" + + "taMessage.Quote\0223\n\007preview\030\n \003(\0132\".signa" + + "lservice.DataMessage.Preview\0225\n\010reaction", + "\030\013 \001(\0132#.signalservice.DataMessage.React" + + "ion\0227\n\007profile\030e \001(\0132&.signalservice.Dat" + + "aMessage.LokiProfile\022K\n\023openGroupInvitat" + + "ion\030f \001(\0132..signalservice.DataMessage.Op" + + "enGroupInvitation\022W\n\031closedGroupControlM" + + "essage\030h \001(\01324.signalservice.DataMessage" + + ".ClosedGroupControlMessage\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(\0132" + + "1.signalservice.DataMessage.Quote.Quoted", + "Attachment\032\231\001\n\020QuotedAttachment\022\023\n\013conte" + + "ntType\030\001 \001(\t\022\020\n\010fileName\030\002 \001(\t\0223\n\tthumbn" + + "ail\030\003 \001(\0132 .signalservice.AttachmentPoin" + + "ter\022\r\n\005flags\030\004 \001(\r\"\032\n\005Flags\022\021\n\rVOICE_MES" + + "SAGE\020\001\032V\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.Att" + + "achmentPointer\032:\n\013LokiProfile\022\023\n\013display" + + "Name\030\001 \001(\t\022\026\n\016profilePicture\030\002 \001(\t\0320\n\023Op" + + "enGroupInvitation\022\013\n\003url\030\001 \002(\t\022\014\n\004name\030\003" + + " \002(\t\032\374\003\n\031ClosedGroupControlMessage\022G\n\004ty", + "pe\030\001 \002(\01629.signalservice.DataMessage.Clo" + + "sedGroupControlMessage.Type\022\021\n\tpublicKey" + + "\030\002 \001(\014\022\014\n\004name\030\003 \001(\t\0221\n\021encryptionKeyPai" + + "r\030\004 \001(\0132\026.signalservice.KeyPair\022\017\n\007membe" + + "rs\030\005 \003(\014\022\016\n\006admins\030\006 \003(\014\022U\n\010wrappers\030\007 \003" + + "(\0132C.signalservice.DataMessage.ClosedGro" + + "upControlMessage.KeyPairWrapper\022\027\n\017expir" + + "ationTimer\030\010 \001(\r\032=\n\016KeyPairWrapper\022\021\n\tpu" + + "blicKey\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\013NAME_CHANGE\020\004\022\021\n\rMEMBERS_ADDED\020\005\022\023\n" + + "\017MEMBERS_REMOVED\020\006\022\017\n\013MEMBER_LEFT\020\007\032\222\001\n\010" + + "Reaction\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\022\r\n\005" + + "emoji\030\003 \001(\t\022:\n\006action\030\004 \002(\0162*.signalserv" + + "ice.DataMessage.Reaction.Action\"\037\n\006Actio" + + "n\022\t\n\005REACT\020\000\022\n\n\006REMOVE\020\001\"$\n\005Flags\022\033\n\027EXP" + + "IRATION_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\007sdpMids\030\004 \003(\t\022\014\n\004uuid\030\005 \002(\t\"f\n\004T", + "ype\022\r\n\tPRE_OFFER\020\006\022\t\n\005OFFER\020\001\022\n\n\006ANSWER\020" + + "\002\022\026\n\022PROVISIONAL_ANSWER\020\003\022\022\n\016ICE_CANDIDA" + + "TES\020\004\022\014\n\010END_CALL\020\005\"\245\004\n\024ConfigurationMes" + + "sage\022E\n\014closedGroups\030\001 \003(\0132/.signalservi" + + "ce.ConfigurationMessage.ClosedGroup\022\022\n\no" + + "penGroups\030\002 \003(\t\022\023\n\013displayName\030\003 \001(\t\022\026\n\016" + + "profilePicture\030\004 \001(\t\022\022\n\nprofileKey\030\005 \001(\014" + + "\022=\n\010contacts\030\006 \003(\0132+.signalservice.Confi" + + "gurationMessage.Contact\032\233\001\n\013ClosedGroup\022" + + "\021\n\tpublicKey\030\001 \001(\014\022\014\n\004name\030\002 \001(\t\0221\n\021encr", + "yptionKeyPair\030\003 \001(\0132\026.signalservice.KeyP" + + "air\022\017\n\007members\030\004 \003(\014\022\016\n\006admins\030\005 \003(\014\022\027\n\017" + + "expirationTimer\030\006 \001(\r\032\223\001\n\007Contact\022\021\n\tpub" + + "licKey\030\001 \002(\014\022\014\n\004name\030\002 \002(\t\022\026\n\016profilePic" + + "ture\030\003 \001(\t\022\022\n\nprofileKey\030\004 \001(\014\022\022\n\nisAppr" + + "oved\030\005 \001(\010\022\021\n\tisBlocked\030\006 \001(\010\022\024\n\014didAppr" + + "oveMe\030\007 \001(\010\",\n\026MessageRequestResponse\022\022\n" + + "\nisApproved\030\001 \002(\010\"u\n\016ReceiptMessage\0220\n\004t" + + "ype\030\001 \002(\0162\".signalservice.ReceiptMessage" + + ".Type\022\021\n\ttimestamp\030\002 \003(\004\"\036\n\004Type\022\014\n\010DELI", + "VERY\020\000\022\010\n\004READ\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\004size\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\005width\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\r" + + "VOICE_MESSAGE\020\001\"\365\001\n\014GroupContext\022\n\n\002id\030\001" + + " \001(\014\022.\n\004type\030\002 \001(\0162 .signalservice.Group" + + "Context.Type\022\014\n\004name\030\003 \001(\t\022\017\n\007members\030\004 " + + "\003(\t\0220\n\006avatar\030\005 \001(\0132 .signalservice.Atta", + "chmentPointer\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\004Q" + + "UIT\020\003\022\020\n\014REQUEST_INFO\020\004B3\n\034org.session.l" + + "ibsignal.protosB\023SignalServiceProtos" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -26882,12 +28770,24 @@ 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", "ExpirationType", "ExpirationTimer", "LastDisappearingMessageChangeTimestamp", }); - internal_static_signalservice_SyncedExpiry_descriptor = + new java.lang.String[] { "DataMessage", "CallMessage", "ReceiptMessage", "TypingMessage", "ConfigurationMessage", "DataExtractionNotification", "UnsendRequest", "MessageRequestResponse", "ExpirationType", "ExpirationTimer", "LastDisappearingMessageChangeTimestamp", "SyncedExpiries", }); + internal_static_signalservice_SyncedExpiries_descriptor = getDescriptor().getMessageTypes().get(4); - internal_static_signalservice_SyncedExpiry_fieldAccessorTable = new + internal_static_signalservice_SyncedExpiries_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_signalservice_SyncedExpiry_descriptor, + internal_static_signalservice_SyncedExpiries_descriptor, + new java.lang.String[] { "ConversationExpiries", }); + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_descriptor = + internal_static_signalservice_SyncedExpiries_descriptor.getNestedTypes().get(0); + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_descriptor, + new java.lang.String[] { "SyncTarget", "Expiries", }); + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_descriptor = + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_descriptor.getNestedTypes().get(0); + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_signalservice_SyncedExpiries_SyncedConversationExpiries_SyncedExpiry_descriptor, new java.lang.String[] { "ServerHash", "ExpirationTimestamp", }); internal_static_signalservice_KeyPair_descriptor = getDescriptor().getMessageTypes().get(5); diff --git a/libsignal/src/main/java/org/session/libsignal/utilities/Snode.kt b/libsignal/src/main/java/org/session/libsignal/utilities/Snode.kt index cfbedb7338..76ce91e52b 100644 --- a/libsignal/src/main/java/org/session/libsignal/utilities/Snode.kt +++ b/libsignal/src/main/java/org/session/libsignal/utilities/Snode.kt @@ -10,7 +10,8 @@ class Snode(val address: String, val port: Int, val publicKeySet: KeySet?) { DeleteMessage("delete"), OxenDaemonRPCCall("oxend_request"), Info("info"), - DeleteAll("delete_all") + DeleteAll("delete_all"), + Expire("expire") } data class KeySet(val ed25519Key: String, val x25519Key: String)