diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java index ba7f4bcac3..f2b2d38b70 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationAdapter.java @@ -87,15 +87,17 @@ public class ConversationAdapter Collections.synchronizedMap(new LRUCache>(MAX_CACHE_SIZE)); private final SparseArray positionToCacheRef = new SparseArray<>(); - private static final int MESSAGE_TYPE_OUTGOING = 0; - private static final int MESSAGE_TYPE_INCOMING = 1; - private static final int MESSAGE_TYPE_UPDATE = 2; - private static final int MESSAGE_TYPE_AUDIO_OUTGOING = 3; - private static final int MESSAGE_TYPE_AUDIO_INCOMING = 4; - private static final int MESSAGE_TYPE_THUMBNAIL_OUTGOING = 5; - private static final int MESSAGE_TYPE_THUMBNAIL_INCOMING = 6; - private static final int MESSAGE_TYPE_DOCUMENT_OUTGOING = 7; - private static final int MESSAGE_TYPE_DOCUMENT_INCOMING = 8; + private static final int MESSAGE_TYPE_OUTGOING = 0; + private static final int MESSAGE_TYPE_INCOMING = 1; + private static final int MESSAGE_TYPE_UPDATE = 2; + private static final int MESSAGE_TYPE_AUDIO_OUTGOING = 3; + private static final int MESSAGE_TYPE_AUDIO_INCOMING = 4; + private static final int MESSAGE_TYPE_THUMBNAIL_OUTGOING = 5; + private static final int MESSAGE_TYPE_THUMBNAIL_INCOMING = 6; + private static final int MESSAGE_TYPE_DOCUMENT_OUTGOING = 7; + private static final int MESSAGE_TYPE_DOCUMENT_INCOMING = 8; + private static final int MESSAGE_TYPE_INVITATION_OUTGOING = 9; + private static final int MESSAGE_TYPE_INVITATION_INCOMING = 10; private final Set batchSelected = Collections.synchronizedSet(new HashSet()); @@ -281,10 +283,12 @@ public class ConversationAdapter case MESSAGE_TYPE_AUDIO_OUTGOING: case MESSAGE_TYPE_THUMBNAIL_OUTGOING: case MESSAGE_TYPE_DOCUMENT_OUTGOING: + case MESSAGE_TYPE_INVITATION_OUTGOING: case MESSAGE_TYPE_OUTGOING: return R.layout.conversation_item_sent; case MESSAGE_TYPE_AUDIO_INCOMING: case MESSAGE_TYPE_THUMBNAIL_INCOMING: case MESSAGE_TYPE_DOCUMENT_INCOMING: + case MESSAGE_TYPE_INVITATION_INCOMING: case MESSAGE_TYPE_INCOMING: return R.layout.conversation_item_received; case MESSAGE_TYPE_UPDATE: return R.layout.conversation_item_update; default: throw new IllegalArgumentException("unsupported item view type given to ConversationAdapter"); @@ -295,6 +299,9 @@ public class ConversationAdapter public int getItemViewType(@NonNull MessageRecord messageRecord) { if (messageRecord.isUpdate()) { return MESSAGE_TYPE_UPDATE; + } else if (messageRecord.isOpenGroupInvitation()) { + if (messageRecord.isOutgoing()) return MESSAGE_TYPE_INVITATION_OUTGOING; + else return MESSAGE_TYPE_INVITATION_INCOMING; } else if (hasAudio(messageRecord)) { if (messageRecord.isOutgoing()) return MESSAGE_TYPE_AUDIO_OUTGOING; else return MESSAGE_TYPE_AUDIO_INCOMING; diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java index b89a7b6962..472a4e5bd2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java @@ -63,7 +63,9 @@ import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAt import org.session.libsession.messaging.sending_receiving.link_preview.LinkPreview; import org.session.libsession.messaging.threads.recipients.Recipient; import org.session.libsession.messaging.threads.recipients.RecipientModifiedListener; +import org.session.libsession.messaging.utilities.UpdateMessageData; import org.session.libsession.utilities.GroupUtil; +import org.session.libsession.utilities.OpenGroupUrlParser; import org.session.libsession.utilities.TextSecurePreferences; import org.session.libsession.utilities.ThemeUtil; import org.session.libsession.utilities.Util; @@ -92,6 +94,7 @@ import org.thoughtcrime.securesms.linkpreview.LinkPreviewUtil; import org.thoughtcrime.securesms.loki.utilities.MentionUtilities; import org.thoughtcrime.securesms.loki.utilities.OpenGroupUtilities; import org.thoughtcrime.securesms.loki.views.MessageAudioView; +import org.thoughtcrime.securesms.loki.views.OpenGroupInvitationView; import org.thoughtcrime.securesms.loki.views.ProfilePictureView; import org.thoughtcrime.securesms.mms.GlideRequests; import org.thoughtcrime.securesms.mms.ImageSlide; @@ -156,6 +159,7 @@ public class ConversationItem extends LinearLayout private Stub documentViewStub; private Stub linkPreviewStub; private Stub stickerStub; + private Stub openGroupInvitationViewStub; private @Nullable EventListener eventListener; private int defaultBubbleColor; @@ -203,6 +207,7 @@ public class ConversationItem extends LinearLayout this.documentViewStub = new Stub<>(findViewById(R.id.document_view_stub)); this.linkPreviewStub = new Stub<>(findViewById(R.id.link_preview_stub)); this.stickerStub = new Stub<>(findViewById(R.id.sticker_view_stub)); + this.openGroupInvitationViewStub = new Stub<>(findViewById(R.id.open_group_invitation_stub)); this.groupSenderHolder = findViewById(R.id.group_sender_holder); this.quoteView = findViewById(R.id.quote_view); this.container = findViewById(R.id.container); @@ -467,7 +472,9 @@ public class ConversationItem extends LinearLayout bodyText.setOverflowText(null); } - bodyText.setText(text); + if (!messageRecord.isOpenGroupInvitation()) + bodyText.setText(text); + bodyText.setVisibility(View.VISIBLE); } } @@ -528,6 +535,7 @@ public class ConversationItem extends LinearLayout if (mediaThumbnailStub.resolved()) mediaThumbnailStub.get().setVisibility(View.GONE); if (documentViewStub.resolved()) documentViewStub.get().setVisibility(View.GONE); if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE); + if (openGroupInvitationViewStub.resolved()) openGroupInvitationViewStub.get().setVisibility(View.GONE); //noinspection ConstantConditions LinkPreview linkPreview = ((MmsMessageRecord) messageRecord).getLinkPreviews().get(0); @@ -564,6 +572,7 @@ public class ConversationItem extends LinearLayout if (documentViewStub.resolved()) documentViewStub.get().setVisibility(View.GONE); if (linkPreviewStub.resolved()) linkPreviewStub.get().setVisibility(GONE); if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE); + if (openGroupInvitationViewStub.resolved()) openGroupInvitationViewStub.get().setVisibility(View.GONE); //noinspection ConstantConditions audioViewStub.get().setAudio(((MediaMmsMessageRecord) messageRecord).getSlideDeck().getAudioSlide(), showControls); @@ -580,6 +589,7 @@ public class ConversationItem extends LinearLayout if (audioViewStub.resolved()) audioViewStub.get().setVisibility(View.GONE); if (linkPreviewStub.resolved()) linkPreviewStub.get().setVisibility(GONE); if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE); + if (openGroupInvitationViewStub.resolved()) openGroupInvitationViewStub.get().setVisibility(View.GONE); //noinspection ConstantConditions documentViewStub.get().setDocument(((MediaMmsMessageRecord) messageRecord).getSlideDeck().getDocumentSlide(), showControls); @@ -597,6 +607,7 @@ public class ConversationItem extends LinearLayout if (documentViewStub.resolved()) documentViewStub.get().setVisibility(View.GONE); if (linkPreviewStub.resolved()) linkPreviewStub.get().setVisibility(GONE); if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE); + if (openGroupInvitationViewStub.resolved()) openGroupInvitationViewStub.get().setVisibility(View.GONE); //noinspection ConstantConditions List thumbnailSlides = ((MmsMessageRecord) messageRecord).getSlideDeck().getThumbnailSlides(); @@ -619,6 +630,29 @@ public class ConversationItem extends LinearLayout ViewUtil.updateLayoutParams(groupSenderHolder, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); footer.setVisibility(VISIBLE); + } else if (messageRecord.isOpenGroupInvitation()) { + openGroupInvitationViewStub.get().setVisibility(View.VISIBLE); + if (mediaThumbnailStub.resolved()) mediaThumbnailStub.get().setVisibility(View.GONE); + if (audioViewStub.resolved()) audioViewStub.get().setVisibility(View.GONE); + if (documentViewStub.resolved()) documentViewStub.get().setVisibility(View.GONE); + if (linkPreviewStub.resolved()) linkPreviewStub.get().setVisibility(GONE); + if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE); + + UpdateMessageData updateMessageData = UpdateMessageData.Companion.fromJSON(messageRecord.getBody()); + String name = null, url = null; + if (updateMessageData.getKind() instanceof UpdateMessageData.Kind.OpenGroupInvitation) { + UpdateMessageData.Kind.OpenGroupInvitation data = (UpdateMessageData.Kind.OpenGroupInvitation)updateMessageData.getKind(); + name = data.getGroupName(); + url = OpenGroupUrlParser.INSTANCE.trimParameter(data.getGroupUrl()); + } + + openGroupInvitationViewStub.get().setOpenGroup(name, url, messageRecord.isOutgoing()); + openGroupInvitationViewStub.get().setOnLongClickListener(passthroughClickListener); + + bodyText.setVisibility(View.GONE); + + ViewUtil.updateLayoutParams(bodyText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + ViewUtil.updateLayoutParams(groupSenderHolder, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); } else { if (mediaThumbnailStub.resolved()) mediaThumbnailStub.get().setVisibility(View.GONE); if (audioViewStub.resolved()) audioViewStub.get().setVisibility(View.GONE); diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/MmsSmsColumns.java b/app/src/main/java/org/thoughtcrime/securesms/database/MmsSmsColumns.java index 024d1f51dd..3826c28faf 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/MmsSmsColumns.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/MmsSmsColumns.java @@ -47,13 +47,15 @@ public interface MmsSmsColumns { BASE_PENDING_INSECURE_SMS_FALLBACK, OUTGOING_CALL_TYPE}; + + //TODO clean unused keys // Message attributes protected static final long MESSAGE_FORCE_SMS_BIT = 0x40; // Key Exchange Information protected static final long KEY_EXCHANGE_MASK = 0xFF00; protected static final long KEY_EXCHANGE_BIT = 0x8000; - protected static final long KEY_EXCHANGE_IDENTITY_VERIFIED_BIT = 0x4000; + protected static final long KEY_EXCHANGE_IDENTITY_VERIFIED_BIT = 0x40000; protected static final long KEY_EXCHANGE_IDENTITY_DEFAULT_BIT = 0x2000; protected static final long KEY_EXCHANGE_CORRUPTED_BIT = 0x1000; protected static final long KEY_EXCHANGE_INVALID_VERSION_BIT = 0x800; @@ -75,6 +77,8 @@ public interface MmsSmsColumns { // Data Extraction Information protected static final long MEDIA_SAVED_EXTRACTION_BIT = 0x01000; protected static final long SCREENSHOT_EXTRACTION_BIT = 0x02000; + // Open Group Invitation + protected static final long OPEN_GROUP_INVITATION_BIT = 0x04000; // Encrypted Storage Information XXX public static final long ENCRYPTION_MASK = 0xFF000000; @@ -210,6 +214,10 @@ public interface MmsSmsColumns { return (type & SCREENSHOT_EXTRACTION_BIT) != 0; } + public static boolean isOpenGroupInvitation(long type) { + return (type & OPEN_GROUP_INVITATION_BIT) != 0; + } + public static boolean isIncomingCall(long type) { return type == INCOMING_CALL_TYPE; } diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/SmsDatabase.java b/app/src/main/java/org/thoughtcrime/securesms/database/SmsDatabase.java index 226645b39c..1da23548da 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/SmsDatabase.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/SmsDatabase.java @@ -350,7 +350,9 @@ public class SmsDatabase extends MessagingDatabase { if (((IncomingGroupMessage)message).isUpdateMessage()) type |= Types.GROUP_UPDATE_MESSAGE_BIT; } - if (message.isPush()) type |= Types.PUSH_MESSAGE_BIT; + if (message.isPush()) type |= Types.PUSH_MESSAGE_BIT; + + if (message.isOpenGroupInvitation()) type |= Types.OPEN_GROUP_INVITATION_BIT; Recipient recipient = Recipient.from(context, message.getSender(), true); @@ -443,8 +445,9 @@ public class SmsDatabase extends MessagingDatabase { { long type = Types.BASE_SENDING_TYPE; - if (message.isSecureMessage()) type |= (Types.SECURE_MESSAGE_BIT | Types.PUSH_MESSAGE_BIT); - if (forceSms) type |= Types.MESSAGE_FORCE_SMS_BIT; + if (message.isSecureMessage()) type |= (Types.SECURE_MESSAGE_BIT | Types.PUSH_MESSAGE_BIT); + if (forceSms) type |= Types.MESSAGE_FORCE_SMS_BIT; + if (message.isOpenGroupInvitation()) type |= Types.OPEN_GROUP_INVITATION_BIT; Address address = message.getRecipient().getAddress(); Map earlyDeliveryReceipts = earlyDeliveryReceiptCache.remove(date); 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 0f449c9f3a..2f014dd90d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -24,7 +24,7 @@ import org.session.libsession.messaging.threads.Address import org.session.libsession.messaging.threads.Address.Companion.fromSerialized import org.session.libsession.messaging.threads.GroupRecord import org.session.libsession.messaging.threads.recipients.Recipient -import org.session.libsession.messaging.utilities.ClosedGroupUpdateMessageData +import org.session.libsession.messaging.utilities.UpdateMessageData import org.session.libsession.utilities.GroupUtil import org.session.libsession.utilities.IdentityKeyUtil import org.session.libsession.utilities.TextSecurePreferences @@ -165,11 +165,15 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context, mmsDatabase.endTransaction() } else { val smsDatabase = DatabaseFactory.getSmsDatabase(context) + val isOpenGroupInvitation = message.openGroupInvitation != null + val insertResult = if (message.sender == getUserPublicKey()) { - val textMessage = OutgoingTextMessage.from(message, targetRecipient) + val textMessage = if (isOpenGroupInvitation) OutgoingTextMessage.fromOpenGroupInvitation(message.openGroupInvitation, targetRecipient, message.sentTimestamp) + else OutgoingTextMessage.from(message, targetRecipient) smsDatabase.insertMessageOutbox(message.threadID ?: -1, textMessage, message.sentTimestamp!!) } else { - val textMessage = IncomingTextMessage.from(message, senderAddress, group, targetRecipient.expireMessages * 1000L) + val textMessage = if (isOpenGroupInvitation) IncomingTextMessage.fromOpenGroupInvitation(message.openGroupInvitation, senderAddress, message.sentTimestamp) + else IncomingTextMessage.from(message, senderAddress, group, targetRecipient.expireMessages * 1000L) val encrypted = IncomingEncryptedMessage(textMessage, textMessage.messageBody) smsDatabase.insertMessageInbox(encrypted, message.receivedTimestamp ?: 0) } @@ -475,7 +479,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context, override fun insertIncomingInfoMessage(context: Context, senderPublicKey: String, groupID: String, type: SignalServiceGroup.Type, name: String, members: Collection, admins: Collection, sentTimestamp: Long) { val group = SignalServiceGroup(type, GroupUtil.getDecodedGroupIDAsData(groupID), SignalServiceGroup.GroupType.SIGNAL, name, members.toList(), null, admins.toList()) val m = IncomingTextMessage(Address.fromSerialized(senderPublicKey), 1, sentTimestamp, "", Optional.of(group), 0, true) - val updateData = ClosedGroupUpdateMessageData.buildGroupUpdate(type, name, members)?.toJSON() + val updateData = UpdateMessageData.buildGroupUpdate(type, name, members)?.toJSON() val infoMessage = IncomingGroupMessage(m, groupID, updateData, true) val smsDB = DatabaseFactory.getSmsDatabase(context) smsDB.insertMessageInbox(infoMessage) @@ -485,7 +489,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context, val userPublicKey = getUserPublicKey() val recipient = Recipient.from(context, Address.fromSerialized(groupID), false) - val updateData = ClosedGroupUpdateMessageData.buildGroupUpdate(type, name, members)?.toJSON() ?: "" + val updateData = UpdateMessageData.buildGroupUpdate(type, name, members)?.toJSON() ?: "" val infoMessage = OutgoingGroupMediaMessage(recipient, updateData, groupID, null, sentTimestamp, 0, true, null, listOf(), listOf()) val mmsDB = DatabaseFactory.getMmsDatabase(context) val mmsSmsDB = DatabaseFactory.getMmsSmsDatabase(context) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/model/DisplayRecord.java b/app/src/main/java/org/thoughtcrime/securesms/database/model/DisplayRecord.java index f98dcda5d9..21d69d4770 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/model/DisplayRecord.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/model/DisplayRecord.java @@ -145,6 +145,12 @@ public abstract class DisplayRecord { return isMediaSavedExtraction() || isScreenshotExtraction(); } + // Open Group Invitation + + public boolean isOpenGroupInvitation() { + return MmsSmsColumns.Types.isOpenGroupInvitation(type); + } + public boolean isCallLog() { return SmsDatabase.Types.isCallLog(type); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/model/MessageRecord.java b/app/src/main/java/org/thoughtcrime/securesms/database/model/MessageRecord.java index 8380c41633..441b6cb988 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/model/MessageRecord.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/model/MessageRecord.java @@ -26,8 +26,8 @@ import android.text.style.StyleSpan; import network.loki.messenger.R; import org.session.libsession.messaging.sending_receiving.data_extraction.DataExtractionNotificationInfoMessage; -import org.session.libsession.messaging.utilities.ClosedGroupUpdateMessageBuilder; -import org.session.libsession.messaging.utilities.ClosedGroupUpdateMessageData; +import org.session.libsession.messaging.utilities.UpdateMessageBuilder; +import org.session.libsession.messaging.utilities.UpdateMessageData; import org.thoughtcrime.securesms.database.MmsSmsColumns; import org.thoughtcrime.securesms.database.SmsDatabase; import org.session.libsession.database.documents.IdentityKeyMismatch; @@ -93,14 +93,14 @@ public abstract class MessageRecord extends DisplayRecord { @Override public SpannableString getDisplayBody(@NonNull Context context) { if(isGroupUpdateMessage()) { - ClosedGroupUpdateMessageData updateMessageData = ClosedGroupUpdateMessageData.Companion.fromJSON(getBody()); - return new SpannableString(ClosedGroupUpdateMessageBuilder.INSTANCE.buildGroupUpdateMessage(context, updateMessageData, getIndividualRecipient().getAddress().serialize(), isOutgoing())); + UpdateMessageData updateMessageData = UpdateMessageData.Companion.fromJSON(getBody()); + return new SpannableString(UpdateMessageBuilder.INSTANCE.buildGroupUpdateMessage(context, updateMessageData, getIndividualRecipient().getAddress().serialize(), isOutgoing())); } else if (isExpirationTimerUpdate()) { int seconds = (int) (getExpiresIn() / 1000); - return new SpannableString(ClosedGroupUpdateMessageBuilder.INSTANCE.buildExpirationTimerMessage(context, seconds, getIndividualRecipient().getAddress().serialize(), isOutgoing())); + return new SpannableString(UpdateMessageBuilder.INSTANCE.buildExpirationTimerMessage(context, seconds, getIndividualRecipient().getAddress().serialize(), isOutgoing())); } else if (isDataExtraction()) { - if (isScreenshotExtraction()) return new SpannableString((ClosedGroupUpdateMessageBuilder.INSTANCE.buildDataExtractionMessage(context, DataExtractionNotificationInfoMessage.Kind.SCREENSHOT, getIndividualRecipient().getAddress().serialize()))); - else if (isMediaSavedExtraction()) return new SpannableString((ClosedGroupUpdateMessageBuilder.INSTANCE.buildDataExtractionMessage(context, DataExtractionNotificationInfoMessage.Kind.MEDIA_SAVED, getIndividualRecipient().getAddress().serialize()))); + if (isScreenshotExtraction()) return new SpannableString((UpdateMessageBuilder.INSTANCE.buildDataExtractionMessage(context, DataExtractionNotificationInfoMessage.Kind.SCREENSHOT, getIndividualRecipient().getAddress().serialize()))); + else if (isMediaSavedExtraction()) return new SpannableString((UpdateMessageBuilder.INSTANCE.buildDataExtractionMessage(context, DataExtractionNotificationInfoMessage.Kind.MEDIA_SAVED, getIndividualRecipient().getAddress().serialize()))); } // TODO below lines are left here for compatibility with older group update messages, it can be deleted later on else if (isGroupUpdate() && isOutgoing()) { diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/JoinPublicChatActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/JoinPublicChatActivity.kt index 6686ca8345..9e8a94fed6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/JoinPublicChatActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/JoinPublicChatActivity.kt @@ -121,7 +121,7 @@ class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCode } } catch (e: Exception) { - Log.e("JoinPublicChatActivity", "Fialed to join open group.", e) + Log.e("JoinPublicChatActivity", "Failed to join open group.", e) withContext(Dispatchers.Main) { hideLoader() Toast.makeText(this@JoinPublicChatActivity, R.string.activity_join_public_chat_error, Toast.LENGTH_SHORT).show() diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/views/OpenGroupInvitationView.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/views/OpenGroupInvitationView.kt new file mode 100644 index 0000000000..fe3b9c0155 --- /dev/null +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/views/OpenGroupInvitationView.kt @@ -0,0 +1,58 @@ +package org.thoughtcrime.securesms.loki.views + +import android.content.Context +import android.graphics.Color +import android.util.AttributeSet +import android.view.View +import android.widget.FrameLayout +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.TextView +import androidx.core.content.ContextCompat +import network.loki.messenger.R +import org.session.libsignal.utilities.logging.Log +import java.io.IOException + +class OpenGroupInvitationView : FrameLayout { + + companion object { + private const val TAG = "OpenGroupInvitationView" + } + + private val joinButton: ImageView + private val openGroupIcon: ImageView + private val groupName: TextView + private val groupUrl: TextView + + constructor(context: Context): this(context, null) + + constructor(context: Context, attrs: AttributeSet?): this(context, attrs, 0) + + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int): super(context, attrs, defStyleAttr) { + View.inflate(context, R.layout.open_group_invitation_view, this) + joinButton = findViewById(R.id.join_open_group) + openGroupIcon = findViewById(R.id.open_group_icon) + groupName = findViewById(R.id.group_name) + groupUrl = findViewById(R.id.group_url) + + joinButton.setOnClickListener { } + } + + fun setOpenGroup(name: String, url: String, isOutgoing: Boolean = false) { + groupName.text = name + groupUrl.text = url + + if(isOutgoing) { + joinButton.visibility = View.GONE + openGroupIcon.visibility = View.VISIBLE + } else { + joinButton.visibility = View.VISIBLE + openGroupIcon.visibility = View.GONE + } + } + + fun joinPublicGroup(url: String) { + + } + +} \ No newline at end of file diff --git a/app/src/main/res/layout/conversation_item_received.xml b/app/src/main/res/layout/conversation_item_received.xml index f0c853828c..ade3ea2c78 100644 --- a/app/src/main/res/layout/conversation_item_received.xml +++ b/app/src/main/res/layout/conversation_item_received.xml @@ -140,6 +140,12 @@ android:layout_height="wrap_content" android:layout="@layout/conversation_item_received_link_preview" /> + + + \ No newline at end of file diff --git a/app/src/main/res/layout/conversation_item_sent.xml b/app/src/main/res/layout/conversation_item_sent.xml index 9dc10706b1..b6a7ff291a 100644 --- a/app/src/main/res/layout/conversation_item_sent.xml +++ b/app/src/main/res/layout/conversation_item_sent.xml @@ -50,13 +50,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/large_spacing" - android:layout_marginBottom="@dimen/medium_spacing" android:layout_marginEnd="@dimen/large_spacing" + android:layout_marginBottom="@dimen/medium_spacing" android:visibility="gone" app:message_type="outgoing" app:quote_colorPrimary="@color/text" app:quote_colorSecondary="@color/text" - tools:visibility="visible"/> + tools:visibility="visible" /> + + + \ No newline at end of file diff --git a/app/src/main/res/layout/open_group_invitation_view.xml b/app/src/main/res/layout/open_group_invitation_view.xml new file mode 100644 index 0000000000..b70dd8dd2c --- /dev/null +++ b/app/src/main/res/layout/open_group_invitation_view.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 5fbc37a757..b4c1cdcd1e 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -782,6 +782,9 @@ Vous avez reçu un message d’échange de clés pour une version de protocole i Lire Mettre en pause Télécharger + + Rejoindre + Invitation à un groupe public Contenu audio Vidéo diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 83997f2bdf..0b5a6f20f1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -948,6 +948,10 @@ Pause Download + + Join + Open group invitation + Audio Video diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/OpenGroupInvitation.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/OpenGroupInvitation.kt deleted file mode 100644 index bbb3653719..0000000000 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/OpenGroupInvitation.kt +++ /dev/null @@ -1,46 +0,0 @@ -package org.session.libsession.messaging.messages.control - -import org.session.libsignal.service.internal.push.SignalServiceProtos -import org.session.libsignal.utilities.logging.Log - -class OpenGroupInvitation() : ControlMessage() { - - var groupUrl: String? = null; - var groupName: String? = null; - - companion object { - const val TAG = "OpenGroupInvitation" - - fun fromProto(proto: SignalServiceProtos.Content): OpenGroupInvitation? { - val openGroupInvitationProto = if (proto.hasOpenGroupInvitation()) proto.openGroupInvitation else return null - val serverAddress = openGroupInvitationProto.groupUrl - val serverName = openGroupInvitationProto.groupName - return OpenGroupInvitation(serverAddress, serverName) - } - } - - constructor(url: String?, serverName: String?): this() { - this.groupUrl = url - this.groupName = serverName - } - - override fun isValid(): Boolean { - if (!super.isValid()) return false - return (groupUrl != null && groupName != null) - } - - override fun toProto(): SignalServiceProtos.Content? { - val openGroupInvitationProto = SignalServiceProtos.OpenGroupInvitation.newBuilder() - openGroupInvitationProto.groupUrl = groupUrl - openGroupInvitationProto.groupName = groupName - - val proto = SignalServiceProtos.Content.newBuilder() - return try { - proto.openGroupInvitation = openGroupInvitationProto.build() - proto.build() - } catch (e: Exception) { - Log.w(TAG, "Couldn't construct open group invitation proto from: $this") - null - } - } -} \ No newline at end of file diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/signal/IncomingTextMessage.java b/libsession/src/main/java/org/session/libsession/messaging/messages/signal/IncomingTextMessage.java index 35b9d40a2c..6cd5a45cac 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/signal/IncomingTextMessage.java +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/signal/IncomingTextMessage.java @@ -5,11 +5,14 @@ import android.os.Parcelable; import androidx.annotation.Nullable; +import org.session.libsession.messaging.messages.visible.OpenGroupInvitation; import org.session.libsession.messaging.messages.visible.VisibleMessage; import org.session.libsession.messaging.threads.Address; +import org.session.libsession.messaging.utilities.UpdateMessageData; import org.session.libsession.utilities.GroupUtil; import org.session.libsignal.libsignal.util.guava.Optional; import org.session.libsignal.service.api.messages.SignalServiceGroup; +import org.session.libsignal.utilities.logging.Log; public class IncomingTextMessage implements Parcelable { @@ -40,6 +43,8 @@ public class IncomingTextMessage implements Parcelable { private final long expiresInMillis; private final boolean unidentified; + private boolean isOpenGroupInvitation = false; + public IncomingTextMessage(Address sender, int senderDeviceId, long sentTimestampMillis, String encodedBody, Optional group, long expiresInMillis, boolean unidentified) @@ -94,6 +99,7 @@ public class IncomingTextMessage implements Parcelable { this.subscriptionId = base.getSubscriptionId(); this.expiresInMillis = base.getExpiresIn(); this.unidentified = base.isUnidentified(); + this.isOpenGroupInvitation= base.isOpenGroupInvitation(); } public static IncomingTextMessage from(VisibleMessage message, @@ -104,6 +110,14 @@ public class IncomingTextMessage implements Parcelable { return new IncomingTextMessage(sender, 1, message.getSentTimestamp(), message.getText(), group, expiresInMillis, false); } + public static IncomingTextMessage fromOpenGroupInvitation(OpenGroupInvitation openGroupInvitation, Address sender, Long sentTimestamp) + { + String body = UpdateMessageData.Companion.buildOpenGroupInvitation(openGroupInvitation.getGroupUrl(), openGroupInvitation.getGroupName()).toJSON(); + IncomingTextMessage incomingTextMessage = new IncomingTextMessage(sender, 1, sentTimestamp, body, Optional.absent(), 0, false); + incomingTextMessage.isOpenGroupInvitation = true; + return incomingTextMessage; + } + public int getSubscriptionId() { return subscriptionId; } @@ -163,6 +177,9 @@ public class IncomingTextMessage implements Parcelable { public boolean isUnidentified() { return unidentified; } + + public boolean isOpenGroupInvitation() { return isOpenGroupInvitation; } + @Override public int describeContents() { return 0; diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/signal/OutgoingTextMessage.java b/libsession/src/main/java/org/session/libsession/messaging/messages/signal/OutgoingTextMessage.java index 9ebd44891e..c56c61ba6b 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/signal/OutgoingTextMessage.java +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/signal/OutgoingTextMessage.java @@ -1,7 +1,9 @@ package org.session.libsession.messaging.messages.signal; +import org.session.libsession.messaging.messages.visible.OpenGroupInvitation; import org.session.libsession.messaging.messages.visible.VisibleMessage; import org.session.libsession.messaging.threads.recipients.Recipient; +import org.session.libsession.messaging.utilities.UpdateMessageData; public class OutgoingTextMessage { @@ -11,6 +13,8 @@ public class OutgoingTextMessage { private final long expiresIn; private final long sentTimestampMillis; + private boolean isOpenGroupInvitation = false; + public OutgoingTextMessage(Recipient recipient, String message, long expiresIn, int subscriptionId, long sentTimestampMillis) { this.recipient = recipient; this.message = message; @@ -23,6 +27,13 @@ public class OutgoingTextMessage { return new OutgoingTextMessage(recipient, message.getText(), recipient.getExpireMessages() * 1000, -1, message.getSentTimestamp()); } + public static OutgoingTextMessage fromOpenGroupInvitation(OpenGroupInvitation openGroupInvitation, Recipient recipient, Long sentTimestamp) { + String body = UpdateMessageData.Companion.buildOpenGroupInvitation(openGroupInvitation.getGroupUrl(), openGroupInvitation.getGroupName()).toJSON(); + OutgoingTextMessage outgoingTextMessage = new OutgoingTextMessage(recipient, body, 0, -1, sentTimestamp); + outgoingTextMessage.isOpenGroupInvitation = true; + return outgoingTextMessage; + } + public long getExpiresIn() { return expiresIn; } @@ -46,4 +57,6 @@ public class OutgoingTextMessage { public boolean isSecureMessage() { return true; } + + public boolean isOpenGroupInvitation() { return isOpenGroupInvitation; } } diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/visible/OpenGroupInvitation.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/OpenGroupInvitation.kt new file mode 100644 index 0000000000..9896aec836 --- /dev/null +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/OpenGroupInvitation.kt @@ -0,0 +1,43 @@ +package org.session.libsession.messaging.messages.visible + +import org.session.libsession.messaging.messages.control.ControlMessage +import org.session.libsignal.service.internal.push.SignalServiceProtos +import org.session.libsignal.utilities.logging.Log + +class OpenGroupInvitation() { + + var groupUrl: String? = null; + var groupName: String? = null; + + companion object { + const val TAG = "OpenGroupInvitation" + + fun fromProto(proto: SignalServiceProtos.DataMessage.OpenGroupInvitation): OpenGroupInvitation? { + val groupUrl = proto.url + val groupName = proto.name + return OpenGroupInvitation(groupUrl, groupName) + } + } + + constructor(url: String?, serverName: String?): this() { + this.groupUrl = url + this.groupName = serverName + } + + fun isValid(): Boolean { + return (groupUrl != null && groupName != null) + } + + fun toProto(): SignalServiceProtos.DataMessage.OpenGroupInvitation? { + val openGroupInvitationProto = SignalServiceProtos.DataMessage.OpenGroupInvitation.newBuilder() + openGroupInvitationProto.url = groupUrl + openGroupInvitationProto.name = groupName + + return try { + openGroupInvitationProto.build() + } catch (e: Exception) { + Log.w(TAG, "Couldn't construct open group invitation proto from: $this") + null + } + } +} \ No newline at end of file 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 63756c0948..5452ba7b51 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 @@ -18,6 +18,7 @@ class VisibleMessage : Message() { var quote: Quote? = null var linkPreview: LinkPreview? = null var profile: Profile? = null + var openGroupInvitation: OpenGroupInvitation? = null override val isSelfSendValid: Boolean = true @@ -42,6 +43,11 @@ class VisibleMessage : Message() { val linkPreview = LinkPreview.fromProto(linkPreviewProto) linkPreview?.let { result.linkPreview = linkPreview } } + val openGroupInvitationProto = if (dataMessage.hasOpenGroupInvitation()) dataMessage.openGroupInvitation else null + openGroupInvitationProto?.let { + val openGroupInvitation = OpenGroupInvitation.fromProto(openGroupInvitationProto) + openGroupInvitation?.let { result.openGroupInvitation = openGroupInvitation} + } // TODO Contact val profile = Profile.fromProto(dataMessage) profile?.let { result.profile = profile } @@ -66,6 +72,7 @@ class VisibleMessage : Message() { if (attachmentIDs.isNotEmpty()) return true val text = text?.trim() ?: return false if (text.isNotEmpty()) return true + if (openGroupInvitation != null) return true return false } @@ -94,6 +101,11 @@ class VisibleMessage : Message() { dataMessage.addAllPreview(listOf(linkPreviewProto)) } } + //Open group invitation + openGroupInvitation?.let { + val openGroupInvitationProto = it.toProto() + if (openGroupInvitationProto != null) dataMessage.openGroupInvitation = openGroupInvitationProto + } //Attachments val attachments = attachmentIDs.mapNotNull { MessagingModuleConfiguration.shared.messageDataProvider.getSignalAttachmentPointer(it) } if (!attachments.all { !it.url.isNullOrEmpty() }) { 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 7fada09958..2c3837f87a 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 @@ -1,13 +1,13 @@ package org.session.libsession.messaging.sending_receiving import android.text.TextUtils -import okhttp3.HttpUrl import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.jobs.AttachmentDownloadJob import org.session.libsession.messaging.jobs.JobQueue import org.session.libsession.messaging.messages.Message import org.session.libsession.messaging.messages.control.* import org.session.libsession.messaging.messages.visible.Attachment +import org.session.libsession.messaging.messages.visible.OpenGroupInvitation import org.session.libsession.messaging.messages.visible.VisibleMessage import org.session.libsession.messaging.sending_receiving.attachments.PointerAttachment import org.session.libsession.messaging.sending_receiving.data_extraction.DataExtractionNotificationInfoMessage @@ -49,7 +49,6 @@ fun MessageReceiver.handle(message: Message, proto: SignalServiceProtos.Content, is ExpirationTimerUpdate -> handleExpirationTimerUpdate(message) is DataExtractionNotification -> handleDataExtractionNotification(message) is ConfigurationMessage -> handleConfigurationMessage(message) - is OpenGroupInvitation -> handleOpenGroupInvitation(message) is VisibleMessage -> handleVisibleMessage(message, proto, openGroupID) } } @@ -150,12 +149,6 @@ private fun handleConfigurationMessage(message: ConfigurationMessage) { storage.addContacts(message.contacts) } -// Open group invitation handling - -fun handleOpenGroupInvitation(message: OpenGroupInvitation) { - //TODO -} - //endregion //region VisibleMessage diff --git a/libsession/src/main/java/org/session/libsession/messaging/utilities/ClosedGroupUpdateMessageBuilder.kt b/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt similarity index 91% rename from libsession/src/main/java/org/session/libsession/messaging/utilities/ClosedGroupUpdateMessageBuilder.kt rename to libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt index 33a6385692..04484f9cc8 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/utilities/ClosedGroupUpdateMessageBuilder.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt @@ -6,9 +6,9 @@ import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.sending_receiving.data_extraction.DataExtractionNotificationInfoMessage import org.session.libsession.utilities.ExpirationUtil -object ClosedGroupUpdateMessageBuilder { +object UpdateMessageBuilder { - fun buildGroupUpdateMessage(context: Context, updateMessageData: ClosedGroupUpdateMessageData, sender: String? = null, isOutgoing: Boolean = false): String { + fun buildGroupUpdateMessage(context: Context, updateMessageData: UpdateMessageData, sender: String? = null, isOutgoing: Boolean = false): String { var message = "" val updateData = updateMessageData.kind ?: return message if (!isOutgoing && sender == null) return message @@ -17,21 +17,21 @@ object ClosedGroupUpdateMessageBuilder { } else { context.getString(R.string.MessageRecord_you) } when (updateData) { - is ClosedGroupUpdateMessageData.Kind.GroupCreation -> { + is UpdateMessageData.Kind.GroupCreation -> { message = if (isOutgoing) { context.getString(R.string.MessageRecord_you_created_a_new_group) } else { context.getString(R.string.MessageRecord_s_added_you_to_the_group, senderName) } } - is ClosedGroupUpdateMessageData.Kind.GroupNameChange -> { + is UpdateMessageData.Kind.GroupNameChange -> { message = if (isOutgoing) { context.getString(R.string.MessageRecord_you_renamed_the_group_to_s, updateData.name) } else { context.getString(R.string.MessageRecord_s_renamed_the_group_to_s, senderName, updateData.name) } } - is ClosedGroupUpdateMessageData.Kind.GroupMemberAdded -> { + is UpdateMessageData.Kind.GroupMemberAdded -> { val members = updateData.updatedMembers.joinToString(", ") { MessagingModuleConfiguration.shared.storage.getDisplayNameForRecipient(it) ?: it } @@ -41,7 +41,7 @@ object ClosedGroupUpdateMessageBuilder { context.getString(R.string.MessageRecord_s_added_s_to_the_group, senderName, members) } } - is ClosedGroupUpdateMessageData.Kind.GroupMemberRemoved -> { + is UpdateMessageData.Kind.GroupMemberRemoved -> { val storage = MessagingModuleConfiguration.shared.storage val userPublicKey = storage.getUserPublicKey()!! // 1st case: you are part of the removed members @@ -63,7 +63,7 @@ object ClosedGroupUpdateMessageBuilder { } } } - is ClosedGroupUpdateMessageData.Kind.GroupMemberLeft -> { + is UpdateMessageData.Kind.GroupMemberLeft -> { message = if (isOutgoing) { context.getString(R.string.MessageRecord_left_group) } else { diff --git a/libsession/src/main/java/org/session/libsession/messaging/utilities/ClosedGroupUpdateMessageData.kt b/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageData.kt similarity index 64% rename from libsession/src/main/java/org/session/libsession/messaging/utilities/ClosedGroupUpdateMessageData.kt rename to libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageData.kt index 47efd03a4c..062576ea6c 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/utilities/ClosedGroupUpdateMessageData.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageData.kt @@ -9,7 +9,7 @@ import org.session.libsignal.utilities.logging.Log import java.util.* // class used to save update messages details -class ClosedGroupUpdateMessageData () { +class UpdateMessageData () { var kind: Kind? = null @@ -20,7 +20,8 @@ class ClosedGroupUpdateMessageData () { JsonSubTypes.Type(Kind.GroupNameChange::class, name = "GroupNameChange"), JsonSubTypes.Type(Kind.GroupMemberAdded::class, name = "GroupMemberAdded"), JsonSubTypes.Type(Kind.GroupMemberRemoved::class, name = "GroupMemberRemoved"), - JsonSubTypes.Type(Kind.GroupMemberLeft::class, name = "GroupMemberLeft") + JsonSubTypes.Type(Kind.GroupMemberLeft::class, name = "GroupMemberLeft"), + JsonSubTypes.Type(Kind.OpenGroupInvitation::class, name = "OpenGroupInvitation") ) sealed class Kind() { class GroupCreation(): Kind() @@ -34,6 +35,9 @@ class ClosedGroupUpdateMessageData () { constructor(): this(Collections.emptyList()) } class GroupMemberLeft(): Kind() + class OpenGroupInvitation(val groupUrl: String, val groupName: String): Kind() { + constructor(): this("", "") + } } constructor(kind: Kind): this() { @@ -41,22 +45,26 @@ class ClosedGroupUpdateMessageData () { } companion object { - val TAG = ClosedGroupUpdateMessageData::class.simpleName + val TAG = UpdateMessageData::class.simpleName - fun buildGroupUpdate(type: SignalServiceGroup.Type, name: String, members: Collection): ClosedGroupUpdateMessageData? { + fun buildGroupUpdate(type: SignalServiceGroup.Type, name: String, members: Collection): UpdateMessageData? { return when(type) { - SignalServiceGroup.Type.CREATION -> ClosedGroupUpdateMessageData(Kind.GroupCreation()) - SignalServiceGroup.Type.NAME_CHANGE -> ClosedGroupUpdateMessageData(Kind.GroupNameChange(name)) - SignalServiceGroup.Type.MEMBER_ADDED -> ClosedGroupUpdateMessageData(Kind.GroupMemberAdded(members)) - SignalServiceGroup.Type.MEMBER_REMOVED -> ClosedGroupUpdateMessageData(Kind.GroupMemberRemoved(members)) - SignalServiceGroup.Type.QUIT -> ClosedGroupUpdateMessageData(Kind.GroupMemberLeft()) + SignalServiceGroup.Type.CREATION -> UpdateMessageData(Kind.GroupCreation()) + SignalServiceGroup.Type.NAME_CHANGE -> UpdateMessageData(Kind.GroupNameChange(name)) + SignalServiceGroup.Type.MEMBER_ADDED -> UpdateMessageData(Kind.GroupMemberAdded(members)) + SignalServiceGroup.Type.MEMBER_REMOVED -> UpdateMessageData(Kind.GroupMemberRemoved(members)) + SignalServiceGroup.Type.QUIT -> UpdateMessageData(Kind.GroupMemberLeft()) else -> null } } - fun fromJSON(json: String): ClosedGroupUpdateMessageData? { + fun buildOpenGroupInvitation(url: String, name: String): UpdateMessageData { + return UpdateMessageData(Kind.OpenGroupInvitation(url, name)) + } + + fun fromJSON(json: String): UpdateMessageData? { return try { - JsonUtil.fromJson(json, ClosedGroupUpdateMessageData::class.java) + JsonUtil.fromJson(json, UpdateMessageData::class.java) } catch (e: JsonParseException) { Log.e(TAG, "${e.message}") null diff --git a/libsession/src/main/java/org/session/libsession/utilities/OpenGroupUrlParser.kt b/libsession/src/main/java/org/session/libsession/utilities/OpenGroupUrlParser.kt index ea610fcd4f..0faa356bd2 100644 --- a/libsession/src/main/java/org/session/libsession/utilities/OpenGroupUrlParser.kt +++ b/libsession/src/main/java/org/session/libsession/utilities/OpenGroupUrlParser.kt @@ -1,38 +1,39 @@ package org.session.libsession.utilities -import java.net.MalformedURLException -import java.net.URL +import okhttp3.HttpUrl object OpenGroupUrlParser { // Error sealed class Error(val description: String) : Exception(description) { - class MalformedUrl(message: String?) : Error("Malformed URL: $message.") + class MalformedUrl() : Error("Malformed URL.") object NoRoomSpecified : Error("No room specified in the URL.") object NoPublicKeySpecified : Error("No public key specified in the URL.") - object WrongQuery : Error("'public_key' argument is missing.") object InvalidPublicKeyProvided : Error("Invalid public key provided.") } - private const val pathPrefix = "/" - private const val queryPrefix = "public_key=" + private const val queryPrefix = "public_key" - fun parseUrl(url: String): OpenGroupRoom { + fun parseUrl(stringUrl: String): OpenGroupRoom { + // Url have to start with 'http://' + val url = if (!stringUrl.startsWith("http")) "http://$stringUrl" else stringUrl // If the URL is malformed, it will throw an exception - val url = try { URL(url) } catch (e: MalformedURLException) { throw Error.MalformedUrl(e.message) } + val httpUrl = HttpUrl.parse(url) ?: throw Error.MalformedUrl() - val host = url.host + val host = httpUrl.host() // Test if the room is specified in the URL - val room = if (!url.path.isNullOrEmpty()) url.path.removePrefix(pathPrefix) else throw Error.NoRoomSpecified + val room = httpUrl.pathSegments().firstOrNull { !it.isNullOrEmpty() } ?: throw Error.NoRoomSpecified // Test if the query is specified in the URL - val query = if (!url.query.isNullOrEmpty()) url.query else throw Error.NoPublicKeySpecified - // Test if 'public_key' is specified in the URL - val publicKey = if (query.contains(queryPrefix)) url.query.removePrefix(queryPrefix) else throw Error.WrongQuery + val publicKey = httpUrl.queryParameter(queryPrefix) ?: throw Error.NoPublicKeySpecified // Public key must be 64 characters if (publicKey.length != 64) throw Error.InvalidPublicKeyProvided return OpenGroupRoom(host,room,publicKey) } + + fun trimParameter(stringUrl: String): String { + return stringUrl.substringBefore("?$queryPrefix") + } } -class OpenGroupRoom(val serverHost: String, val room: String, val serverPublicKey: String) {} +class OpenGroupRoom(val serverHost: String, val room: String, val serverPublicKey: String) { } diff --git a/libsession/src/test/java/org/session/libsession/utilities/OpenGroupUrlParserTest.kt b/libsession/src/test/java/org/session/libsession/utilities/OpenGroupUrlParserTest.kt index 1d82c849d3..a5d7bcef90 100644 --- a/libsession/src/test/java/org/session/libsession/utilities/OpenGroupUrlParserTest.kt +++ b/libsession/src/test/java/org/session/libsession/utilities/OpenGroupUrlParserTest.kt @@ -19,6 +19,20 @@ class OpenGroupUrlParserTest { assertEquals(expectedPublicKey, result.serverPublicKey) } + @Test + fun parseUrlNoHttpTest() { + val inputUrl = "sessionopengroup.co/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" + + val expectedHost = "sessionopengroup.co" + val expectedRoom = "main" + val expectedPublicKey = "658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" + + val result = OpenGroupUrlParser.parseUrl(inputUrl) + assertEquals(expectedHost, result.serverHost) + assertEquals(expectedRoom, result.room) + assertEquals(expectedPublicKey, result.serverPublicKey) + } + @Test fun parseUrlWithIpTest() { val inputUrl = "https://143.198.213.255:80/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" @@ -33,9 +47,23 @@ class OpenGroupUrlParserTest { assertEquals(expectedPublicKey, result.serverPublicKey) } + @Test + fun parseUrlWithIpAndNoHttpTest() { + val inputUrl = "143.198.213.255/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" + + val expectedHost = "143.198.213.255" + val expectedRoom = "main" + val expectedPublicKey = "658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" + + val result = OpenGroupUrlParser.parseUrl(inputUrl) + assertEquals(expectedHost, result.serverHost) + assertEquals(expectedRoom, result.room) + assertEquals(expectedPublicKey, result.serverPublicKey) + } + @Test(expected = OpenGroupUrlParser.Error.MalformedUrl::class) fun parseUrlMalformedUrlTest() { - val inputUrl = "sessionopengroup.co/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" + val inputUrl = "file:sessionopengroup.co/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" OpenGroupUrlParser.parseUrl(inputUrl) } @@ -51,12 +79,6 @@ class OpenGroupUrlParserTest { OpenGroupUrlParser.parseUrl(inputUrl) } - @Test(expected = OpenGroupUrlParser.Error.WrongQuery::class) - fun parseUrlWrongQueryTest() { - val inputUrl = "https://sessionopengroup.co/main?publickey=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c" - OpenGroupUrlParser.parseUrl(inputUrl) - } - @Test(expected = OpenGroupUrlParser.Error.InvalidPublicKeyProvided::class) fun parseUrlInvalidPublicKeyProviedTest() { val inputUrl = "https://sessionopengroup.co/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adff" diff --git a/libsignal/protobuf/SignalService.proto b/libsignal/protobuf/SignalService.proto index e5f286cca8..c83d557e85 100644 --- a/libsignal/protobuf/SignalService.proto +++ b/libsignal/protobuf/SignalService.proto @@ -41,7 +41,7 @@ message Content { optional TypingMessage typingMessage = 6; optional ConfigurationMessage configurationMessage = 7; optional DataExtractionNotification dataExtractionNotification = 8; - optional OpenGroupInvitation openGroupInvitation = 9; + } message KeyPair { @@ -103,6 +103,13 @@ message DataMessage { optional string profilePicture = 2; } + message OpenGroupInvitation { + // @required + required string url = 1; + // @required + required string name = 3; + } + message ClosedGroupControlMessage { enum Type { @@ -141,15 +148,11 @@ message DataMessage { optional Quote quote = 8; repeated Preview preview = 10; optional LokiProfile profile = 101; + optional OpenGroupInvitation openGroupInvitation = 102; optional ClosedGroupControlMessage closedGroupControlMessage = 104; optional string syncTarget = 105; } -message OpenGroupInvitation { - optional string groupUrl = 1; - optional string groupName = 2; - } - message ConfigurationMessage { message ClosedGroup { diff --git a/libsignal/src/main/java/org/session/libsignal/service/internal/push/SignalServiceProtos.java b/libsignal/src/main/java/org/session/libsignal/service/internal/push/SignalServiceProtos.java index 8f48a9d8d9..773b46f092 100644 --- a/libsignal/src/main/java/org/session/libsignal/service/internal/push/SignalServiceProtos.java +++ b/libsignal/src/main/java/org/session/libsignal/service/internal/push/SignalServiceProtos.java @@ -1778,20 +1778,6 @@ public final class SignalServiceProtos { * optional .signalservice.DataExtractionNotification dataExtractionNotification = 8; */ org.session.libsignal.service.internal.push.SignalServiceProtos.DataExtractionNotificationOrBuilder getDataExtractionNotificationOrBuilder(); - - // optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - boolean hasOpenGroupInvitation(); - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation getOpenGroupInvitation(); - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitationOrBuilder getOpenGroupInvitationOrBuilder(); } /** * Protobuf type {@code signalservice.Content} @@ -1909,19 +1895,6 @@ public final class SignalServiceProtos { bitField0_ |= 0x00000010; break; } - case 74: { - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - subBuilder = openGroupInvitation_.toBuilder(); - } - openGroupInvitation_ = input.readMessage(org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(openGroupInvitation_); - openGroupInvitation_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -2072,35 +2045,12 @@ public final class SignalServiceProtos { return dataExtractionNotification_; } - // optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - public static final int OPENGROUPINVITATION_FIELD_NUMBER = 9; - private org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation openGroupInvitation_; - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public boolean hasOpenGroupInvitation() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation getOpenGroupInvitation() { - return openGroupInvitation_; - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitationOrBuilder getOpenGroupInvitationOrBuilder() { - return openGroupInvitation_; - } - private void initFields() { dataMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.getDefaultInstance(); receiptMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.ReceiptMessage.getDefaultInstance(); typingMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.TypingMessage.getDefaultInstance(); configurationMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.ConfigurationMessage.getDefaultInstance(); dataExtractionNotification_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataExtractionNotification.getDefaultInstance(); - openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -2159,9 +2109,6 @@ public final class SignalServiceProtos { if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeMessage(8, dataExtractionNotification_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(9, openGroupInvitation_); - } getUnknownFields().writeTo(output); } @@ -2191,10 +2138,6 @@ public final class SignalServiceProtos { size += com.google.protobuf.CodedOutputStream .computeMessageSize(8, dataExtractionNotification_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, openGroupInvitation_); - } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -2308,7 +2251,6 @@ public final class SignalServiceProtos { getTypingMessageFieldBuilder(); getConfigurationMessageFieldBuilder(); getDataExtractionNotificationFieldBuilder(); - getOpenGroupInvitationFieldBuilder(); } } private static Builder create() { @@ -2347,12 +2289,6 @@ public final class SignalServiceProtos { dataExtractionNotificationBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000010); - if (openGroupInvitationBuilder_ == null) { - openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.getDefaultInstance(); - } else { - openGroupInvitationBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -2421,14 +2357,6 @@ public final class SignalServiceProtos { } else { result.dataExtractionNotification_ = dataExtractionNotificationBuilder_.build(); } - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - if (openGroupInvitationBuilder_ == null) { - result.openGroupInvitation_ = openGroupInvitation_; - } else { - result.openGroupInvitation_ = openGroupInvitationBuilder_.build(); - } result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -2460,9 +2388,6 @@ public final class SignalServiceProtos { if (other.hasDataExtractionNotification()) { mergeDataExtractionNotification(other.getDataExtractionNotification()); } - if (other.hasOpenGroupInvitation()) { - mergeOpenGroupInvitation(other.getOpenGroupInvitation()); - } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -3105,123 +3030,6 @@ public final class SignalServiceProtos { return dataExtractionNotificationBuilder_; } - // optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - private org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitationOrBuilder> openGroupInvitationBuilder_; - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public boolean hasOpenGroupInvitation() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation getOpenGroupInvitation() { - if (openGroupInvitationBuilder_ == null) { - return openGroupInvitation_; - } else { - return openGroupInvitationBuilder_.getMessage(); - } - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public Builder setOpenGroupInvitation(org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation value) { - if (openGroupInvitationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - openGroupInvitation_ = value; - onChanged(); - } else { - openGroupInvitationBuilder_.setMessage(value); - } - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public Builder setOpenGroupInvitation( - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder builderForValue) { - if (openGroupInvitationBuilder_ == null) { - openGroupInvitation_ = builderForValue.build(); - onChanged(); - } else { - openGroupInvitationBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public Builder mergeOpenGroupInvitation(org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation value) { - if (openGroupInvitationBuilder_ == null) { - if (((bitField0_ & 0x00000020) == 0x00000020) && - openGroupInvitation_ != org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.getDefaultInstance()) { - openGroupInvitation_ = - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.newBuilder(openGroupInvitation_).mergeFrom(value).buildPartial(); - } else { - openGroupInvitation_ = value; - } - onChanged(); - } else { - openGroupInvitationBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public Builder clearOpenGroupInvitation() { - if (openGroupInvitationBuilder_ == null) { - openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.getDefaultInstance(); - onChanged(); - } else { - openGroupInvitationBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder getOpenGroupInvitationBuilder() { - bitField0_ |= 0x00000020; - onChanged(); - return getOpenGroupInvitationFieldBuilder().getBuilder(); - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitationOrBuilder getOpenGroupInvitationOrBuilder() { - if (openGroupInvitationBuilder_ != null) { - return openGroupInvitationBuilder_.getMessageOrBuilder(); - } else { - return openGroupInvitation_; - } - } - /** - * optional .signalservice.OpenGroupInvitation openGroupInvitation = 9; - */ - private com.google.protobuf.SingleFieldBuilder< - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitationOrBuilder> - getOpenGroupInvitationFieldBuilder() { - if (openGroupInvitationBuilder_ == null) { - openGroupInvitationBuilder_ = new com.google.protobuf.SingleFieldBuilder< - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitationOrBuilder>( - openGroupInvitation_, - getParentForChildren(), - isClean()); - openGroupInvitation_ = null; - } - return openGroupInvitationBuilder_; - } - // @@protoc_insertion_point(builder_scope:signalservice.Content) } @@ -4562,6 +4370,20 @@ public final class SignalServiceProtos { */ org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.LokiProfileOrBuilder getProfileOrBuilder(); + // optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + boolean hasOpenGroupInvitation(); + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation getOpenGroupInvitation(); + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitationOrBuilder getOpenGroupInvitationOrBuilder(); + // optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; /** * optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; @@ -4722,9 +4544,22 @@ public final class SignalServiceProtos { bitField0_ |= 0x00000080; break; } + case 818: { + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = openGroupInvitation_.toBuilder(); + } + openGroupInvitation_ = input.readMessage(org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(openGroupInvitation_); + openGroupInvitation_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } case 834: { org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.Builder subBuilder = null; - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000200) == 0x00000200)) { subBuilder = closedGroupControlMessage_.toBuilder(); } closedGroupControlMessage_ = input.readMessage(org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.PARSER, extensionRegistry); @@ -4732,11 +4567,11 @@ public final class SignalServiceProtos { subBuilder.mergeFrom(closedGroupControlMessage_); closedGroupControlMessage_ = subBuilder.buildPartial(); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; break; } case 842: { - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; syncTarget_ = input.readBytes(); break; } @@ -8535,6 +8370,745 @@ public final class SignalServiceProtos { // @@protoc_insertion_point(class_scope:signalservice.DataMessage.LokiProfile) } + public interface OpenGroupInvitationOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string url = 1; + /** + * required string url = 1; + * + *
+       * @required
+       * 
+ */ + boolean hasUrl(); + /** + * required string url = 1; + * + *
+       * @required
+       * 
+ */ + java.lang.String getUrl(); + /** + * required string url = 1; + * + *
+       * @required
+       * 
+ */ + com.google.protobuf.ByteString + getUrlBytes(); + + // required string name = 3; + /** + * required string name = 3; + * + *
+       * @required
+       * 
+ */ + boolean hasName(); + /** + * required string name = 3; + * + *
+       * @required
+       * 
+ */ + java.lang.String getName(); + /** + * required string name = 3; + * + *
+       * @required
+       * 
+ */ + com.google.protobuf.ByteString + getNameBytes(); + } + /** + * Protobuf type {@code signalservice.DataMessage.OpenGroupInvitation} + */ + public static final class OpenGroupInvitation extends + com.google.protobuf.GeneratedMessage + implements OpenGroupInvitationOrBuilder { + // Use OpenGroupInvitation.newBuilder() to construct. + private OpenGroupInvitation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private OpenGroupInvitation(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final OpenGroupInvitation defaultInstance; + public static OpenGroupInvitation getDefaultInstance() { + return defaultInstance; + } + + public OpenGroupInvitation getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private OpenGroupInvitation( + 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; + url_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000002; + name_ = input.readBytes(); + 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.service.internal.push.SignalServiceProtos.internal_static_signalservice_DataMessage_OpenGroupInvitation_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_DataMessage_OpenGroupInvitation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.class, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public OpenGroupInvitation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OpenGroupInvitation(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string url = 1; + public static final int URL_FIELD_NUMBER = 1; + private java.lang.Object url_; + /** + * required string url = 1; + * + *
+       * @required
+       * 
+ */ + public boolean hasUrl() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string url = 1; + * + *
+       * @required
+       * 
+ */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + 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()) { + url_ = s; + } + return s; + } + } + /** + * required string url = 1; + * + *
+       * @required
+       * 
+ */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required string name = 3; + public static final int NAME_FIELD_NUMBER = 3; + private java.lang.Object name_; + /** + * required string name = 3; + * + *
+       * @required
+       * 
+ */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string name = 3; + * + *
+       * @required
+       * 
+ */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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()) { + name_ = s; + } + return s; + } + } + /** + * required string name = 3; + * + *
+       * @required
+       * 
+ */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + url_ = ""; + name_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasUrl()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasName()) { + 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, getUrlBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(3, getNameBytes()); + } + 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, getUrlBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getNameBytes()); + } + 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.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation 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.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation 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.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation 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.DataMessage.OpenGroupInvitation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_DataMessage_OpenGroupInvitation_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_DataMessage_OpenGroupInvitation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.class, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder.class); + } + + // Construct using org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.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(); + url_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_DataMessage_OpenGroupInvitation_descriptor; + } + + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation getDefaultInstanceForType() { + return org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.getDefaultInstance(); + } + + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation build() { + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation buildPartial() { + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation result = new org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.url_ = url_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation) { + return mergeFrom((org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation other) { + if (other == org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.getDefaultInstance()) return this; + if (other.hasUrl()) { + bitField0_ |= 0x00000001; + url_ = other.url_; + onChanged(); + } + if (other.hasName()) { + bitField0_ |= 0x00000002; + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasUrl()) { + + return false; + } + if (!hasName()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string url = 1; + private java.lang.Object url_ = ""; + /** + * required string url = 1; + * + *
+         * @required
+         * 
+ */ + public boolean hasUrl() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string url = 1; + * + *
+         * @required
+         * 
+ */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string url = 1; + * + *
+         * @required
+         * 
+ */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string url = 1; + * + *
+         * @required
+         * 
+ */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + url_ = value; + onChanged(); + return this; + } + /** + * required string url = 1; + * + *
+         * @required
+         * 
+ */ + public Builder clearUrl() { + bitField0_ = (bitField0_ & ~0x00000001); + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + * required string url = 1; + * + *
+         * @required
+         * 
+ */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + url_ = value; + onChanged(); + return this; + } + + // required string name = 3; + private java.lang.Object name_ = ""; + /** + * required string name = 3; + * + *
+         * @required
+         * 
+ */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string name = 3; + * + *
+         * @required
+         * 
+ */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string name = 3; + * + *
+         * @required
+         * 
+ */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string name = 3; + * + *
+         * @required
+         * 
+ */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + /** + * required string name = 3; + * + *
+         * @required
+         * 
+ */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * required string name = 3; + * + *
+         * @required
+         * 
+ */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:signalservice.DataMessage.OpenGroupInvitation) + } + + static { + defaultInstance = new OpenGroupInvitation(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:signalservice.DataMessage.OpenGroupInvitation) + } + public interface ClosedGroupControlMessageOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -11065,6 +11639,28 @@ public final class SignalServiceProtos { return profile_; } + // optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + public static final int OPENGROUPINVITATION_FIELD_NUMBER = 102; + private org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation openGroupInvitation_; + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public boolean hasOpenGroupInvitation() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation getOpenGroupInvitation() { + return openGroupInvitation_; + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitationOrBuilder getOpenGroupInvitationOrBuilder() { + return openGroupInvitation_; + } + // optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; public static final int CLOSEDGROUPCONTROLMESSAGE_FIELD_NUMBER = 104; private org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage_; @@ -11072,7 +11668,7 @@ public final class SignalServiceProtos { * optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; */ public boolean hasClosedGroupControlMessage() { - return ((bitField0_ & 0x00000100) == 0x00000100); + return ((bitField0_ & 0x00000200) == 0x00000200); } /** * optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; @@ -11094,7 +11690,7 @@ public final class SignalServiceProtos { * optional string syncTarget = 105; */ public boolean hasSyncTarget() { - return ((bitField0_ & 0x00000200) == 0x00000200); + return ((bitField0_ & 0x00000400) == 0x00000400); } /** * optional string syncTarget = 105; @@ -11141,6 +11737,7 @@ public final class SignalServiceProtos { quote_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.Quote.getDefaultInstance(); preview_ = java.util.Collections.emptyList(); profile_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.LokiProfile.getDefaultInstance(); + openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.getDefaultInstance(); closedGroupControlMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.getDefaultInstance(); syncTarget_ = ""; } @@ -11173,6 +11770,12 @@ public final class SignalServiceProtos { return false; } } + if (hasOpenGroupInvitation()) { + if (!getOpenGroupInvitation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } if (hasClosedGroupControlMessage()) { if (!getClosedGroupControlMessage().isInitialized()) { memoizedIsInitialized = 0; @@ -11217,9 +11820,12 @@ public final class SignalServiceProtos { output.writeMessage(101, profile_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeMessage(104, closedGroupControlMessage_); + output.writeMessage(102, openGroupInvitation_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeMessage(104, closedGroupControlMessage_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { output.writeBytes(105, getSyncTargetBytes()); } getUnknownFields().writeTo(output); @@ -11273,9 +11879,13 @@ public final class SignalServiceProtos { } if (((bitField0_ & 0x00000100) == 0x00000100)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(104, closedGroupControlMessage_); + .computeMessageSize(102, openGroupInvitation_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(104, closedGroupControlMessage_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(105, getSyncTargetBytes()); } @@ -11392,6 +12002,7 @@ public final class SignalServiceProtos { getQuoteFieldBuilder(); getPreviewFieldBuilder(); getProfileFieldBuilder(); + getOpenGroupInvitationFieldBuilder(); getClosedGroupControlMessageFieldBuilder(); } } @@ -11441,14 +12052,20 @@ public final class SignalServiceProtos { profileBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000200); + if (openGroupInvitationBuilder_ == null) { + openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.getDefaultInstance(); + } else { + openGroupInvitationBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); if (closedGroupControlMessageBuilder_ == null) { closedGroupControlMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.getDefaultInstance(); } else { closedGroupControlMessageBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000400); - syncTarget_ = ""; bitField0_ = (bitField0_ & ~0x00000800); + syncTarget_ = ""; + bitField0_ = (bitField0_ & ~0x00001000); return this; } @@ -11542,13 +12159,21 @@ public final class SignalServiceProtos { if (((from_bitField0_ & 0x00000400) == 0x00000400)) { to_bitField0_ |= 0x00000100; } + if (openGroupInvitationBuilder_ == null) { + result.openGroupInvitation_ = openGroupInvitation_; + } else { + result.openGroupInvitation_ = openGroupInvitationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000200; + } if (closedGroupControlMessageBuilder_ == null) { result.closedGroupControlMessage_ = closedGroupControlMessage_; } else { result.closedGroupControlMessage_ = closedGroupControlMessageBuilder_.build(); } - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { - to_bitField0_ |= 0x00000200; + if (((from_bitField0_ & 0x00001000) == 0x00001000)) { + to_bitField0_ |= 0x00000400; } result.syncTarget_ = syncTarget_; result.bitField0_ = to_bitField0_; @@ -11645,11 +12270,14 @@ public final class SignalServiceProtos { if (other.hasProfile()) { mergeProfile(other.getProfile()); } + if (other.hasOpenGroupInvitation()) { + mergeOpenGroupInvitation(other.getOpenGroupInvitation()); + } if (other.hasClosedGroupControlMessage()) { mergeClosedGroupControlMessage(other.getClosedGroupControlMessage()); } if (other.hasSyncTarget()) { - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; syncTarget_ = other.syncTarget_; onChanged(); } @@ -11682,6 +12310,12 @@ public final class SignalServiceProtos { return false; } } + if (hasOpenGroupInvitation()) { + if (!getOpenGroupInvitation().isInitialized()) { + + return false; + } + } if (hasClosedGroupControlMessage()) { if (!getClosedGroupControlMessage().isInitialized()) { @@ -12750,6 +13384,123 @@ public final class SignalServiceProtos { return profileBuilder_; } + // optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + private org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitationOrBuilder> openGroupInvitationBuilder_; + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public boolean hasOpenGroupInvitation() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation getOpenGroupInvitation() { + if (openGroupInvitationBuilder_ == null) { + return openGroupInvitation_; + } else { + return openGroupInvitationBuilder_.getMessage(); + } + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public Builder setOpenGroupInvitation(org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation value) { + if (openGroupInvitationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + openGroupInvitation_ = value; + onChanged(); + } else { + openGroupInvitationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public Builder setOpenGroupInvitation( + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder builderForValue) { + if (openGroupInvitationBuilder_ == null) { + openGroupInvitation_ = builderForValue.build(); + onChanged(); + } else { + openGroupInvitationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public Builder mergeOpenGroupInvitation(org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation value) { + if (openGroupInvitationBuilder_ == null) { + if (((bitField0_ & 0x00000400) == 0x00000400) && + openGroupInvitation_ != org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.getDefaultInstance()) { + openGroupInvitation_ = + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.newBuilder(openGroupInvitation_).mergeFrom(value).buildPartial(); + } else { + openGroupInvitation_ = value; + } + onChanged(); + } else { + openGroupInvitationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public Builder clearOpenGroupInvitation() { + if (openGroupInvitationBuilder_ == null) { + openGroupInvitation_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.getDefaultInstance(); + onChanged(); + } else { + openGroupInvitationBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder getOpenGroupInvitationBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getOpenGroupInvitationFieldBuilder().getBuilder(); + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitationOrBuilder getOpenGroupInvitationOrBuilder() { + if (openGroupInvitationBuilder_ != null) { + return openGroupInvitationBuilder_.getMessageOrBuilder(); + } else { + return openGroupInvitation_; + } + } + /** + * optional .signalservice.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + */ + private com.google.protobuf.SingleFieldBuilder< + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitationOrBuilder> + getOpenGroupInvitationFieldBuilder() { + if (openGroupInvitationBuilder_ == null) { + openGroupInvitationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitation.Builder, org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.OpenGroupInvitationOrBuilder>( + openGroupInvitation_, + getParentForChildren(), + isClean()); + openGroupInvitation_ = null; + } + return openGroupInvitationBuilder_; + } + // optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; private org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -12758,7 +13509,7 @@ public final class SignalServiceProtos { * optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; */ public boolean hasClosedGroupControlMessage() { - return ((bitField0_ & 0x00000400) == 0x00000400); + return ((bitField0_ & 0x00000800) == 0x00000800); } /** * optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; @@ -12783,7 +13534,7 @@ public final class SignalServiceProtos { } else { closedGroupControlMessageBuilder_.setMessage(value); } - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; return this; } /** @@ -12797,7 +13548,7 @@ public final class SignalServiceProtos { } else { closedGroupControlMessageBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; return this; } /** @@ -12805,7 +13556,7 @@ public final class SignalServiceProtos { */ public Builder mergeClosedGroupControlMessage(org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage value) { if (closedGroupControlMessageBuilder_ == null) { - if (((bitField0_ & 0x00000400) == 0x00000400) && + if (((bitField0_ & 0x00000800) == 0x00000800) && closedGroupControlMessage_ != org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.getDefaultInstance()) { closedGroupControlMessage_ = org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.newBuilder(closedGroupControlMessage_).mergeFrom(value).buildPartial(); @@ -12816,7 +13567,7 @@ public final class SignalServiceProtos { } else { closedGroupControlMessageBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; return this; } /** @@ -12829,14 +13580,14 @@ public final class SignalServiceProtos { } else { closedGroupControlMessageBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000800); return this; } /** * optional .signalservice.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; */ public org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage.Builder getClosedGroupControlMessageBuilder() { - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); return getClosedGroupControlMessageFieldBuilder().getBuilder(); } @@ -12873,7 +13624,7 @@ public final class SignalServiceProtos { * optional string syncTarget = 105; */ public boolean hasSyncTarget() { - return ((bitField0_ & 0x00000800) == 0x00000800); + return ((bitField0_ & 0x00001000) == 0x00001000); } /** * optional string syncTarget = 105; @@ -12913,7 +13664,7 @@ public final class SignalServiceProtos { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; syncTarget_ = value; onChanged(); return this; @@ -12922,7 +13673,7 @@ public final class SignalServiceProtos { * optional string syncTarget = 105; */ public Builder clearSyncTarget() { - bitField0_ = (bitField0_ & ~0x00000800); + bitField0_ = (bitField0_ & ~0x00001000); syncTarget_ = getDefaultInstance().getSyncTarget(); onChanged(); return this; @@ -12935,7 +13686,7 @@ public final class SignalServiceProtos { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; syncTarget_ = value; onChanged(); return this; @@ -12952,633 +13703,6 @@ public final class SignalServiceProtos { // @@protoc_insertion_point(class_scope:signalservice.DataMessage) } - public interface OpenGroupInvitationOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // optional string groupUrl = 1; - /** - * optional string groupUrl = 1; - */ - boolean hasGroupUrl(); - /** - * optional string groupUrl = 1; - */ - java.lang.String getGroupUrl(); - /** - * optional string groupUrl = 1; - */ - com.google.protobuf.ByteString - getGroupUrlBytes(); - - // optional string groupName = 2; - /** - * optional string groupName = 2; - */ - boolean hasGroupName(); - /** - * optional string groupName = 2; - */ - java.lang.String getGroupName(); - /** - * optional string groupName = 2; - */ - com.google.protobuf.ByteString - getGroupNameBytes(); - } - /** - * Protobuf type {@code signalservice.OpenGroupInvitation} - */ - public static final class OpenGroupInvitation extends - com.google.protobuf.GeneratedMessage - implements OpenGroupInvitationOrBuilder { - // Use OpenGroupInvitation.newBuilder() to construct. - private OpenGroupInvitation(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private OpenGroupInvitation(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final OpenGroupInvitation defaultInstance; - public static OpenGroupInvitation getDefaultInstance() { - return defaultInstance; - } - - public OpenGroupInvitation getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpenGroupInvitation( - 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; - groupUrl_ = input.readBytes(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - groupName_ = input.readBytes(); - 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.service.internal.push.SignalServiceProtos.internal_static_signalservice_OpenGroupInvitation_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_OpenGroupInvitation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.class, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public OpenGroupInvitation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpenGroupInvitation(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - // optional string groupUrl = 1; - public static final int GROUPURL_FIELD_NUMBER = 1; - private java.lang.Object groupUrl_; - /** - * optional string groupUrl = 1; - */ - public boolean hasGroupUrl() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string groupUrl = 1; - */ - public java.lang.String getGroupUrl() { - java.lang.Object ref = groupUrl_; - 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()) { - groupUrl_ = s; - } - return s; - } - } - /** - * optional string groupUrl = 1; - */ - public com.google.protobuf.ByteString - getGroupUrlBytes() { - java.lang.Object ref = groupUrl_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - groupUrl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // optional string groupName = 2; - public static final int GROUPNAME_FIELD_NUMBER = 2; - private java.lang.Object groupName_; - /** - * optional string groupName = 2; - */ - public boolean hasGroupName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string groupName = 2; - */ - public java.lang.String getGroupName() { - java.lang.Object ref = groupName_; - 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()) { - groupName_ = s; - } - return s; - } - } - /** - * optional string groupName = 2; - */ - public com.google.protobuf.ByteString - getGroupNameBytes() { - java.lang.Object ref = groupName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - groupName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - groupUrl_ = ""; - groupName_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getGroupUrlBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getGroupNameBytes()); - } - 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, getGroupUrlBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getGroupNameBytes()); - } - 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.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation 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.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation 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.service.internal.push.SignalServiceProtos.OpenGroupInvitation 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.OpenGroupInvitation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_OpenGroupInvitation_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_OpenGroupInvitation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.class, org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.Builder.class); - } - - // Construct using org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.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(); - groupUrl_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - groupName_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.session.libsignal.service.internal.push.SignalServiceProtos.internal_static_signalservice_OpenGroupInvitation_descriptor; - } - - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation getDefaultInstanceForType() { - return org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.getDefaultInstance(); - } - - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation build() { - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation buildPartial() { - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation result = new org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.groupUrl_ = groupUrl_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.groupName_ = groupName_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation) { - return mergeFrom((org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation other) { - if (other == org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation.getDefaultInstance()) return this; - if (other.hasGroupUrl()) { - bitField0_ |= 0x00000001; - groupUrl_ = other.groupUrl_; - onChanged(); - } - if (other.hasGroupName()) { - bitField0_ |= 0x00000002; - groupName_ = other.groupName_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.session.libsignal.service.internal.push.SignalServiceProtos.OpenGroupInvitation) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - // optional string groupUrl = 1; - private java.lang.Object groupUrl_ = ""; - /** - * optional string groupUrl = 1; - */ - public boolean hasGroupUrl() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string groupUrl = 1; - */ - public java.lang.String getGroupUrl() { - java.lang.Object ref = groupUrl_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - groupUrl_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string groupUrl = 1; - */ - public com.google.protobuf.ByteString - getGroupUrlBytes() { - java.lang.Object ref = groupUrl_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - groupUrl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string groupUrl = 1; - */ - public Builder setGroupUrl( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - groupUrl_ = value; - onChanged(); - return this; - } - /** - * optional string groupUrl = 1; - */ - public Builder clearGroupUrl() { - bitField0_ = (bitField0_ & ~0x00000001); - groupUrl_ = getDefaultInstance().getGroupUrl(); - onChanged(); - return this; - } - /** - * optional string groupUrl = 1; - */ - public Builder setGroupUrlBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - groupUrl_ = value; - onChanged(); - return this; - } - - // optional string groupName = 2; - private java.lang.Object groupName_ = ""; - /** - * optional string groupName = 2; - */ - public boolean hasGroupName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string groupName = 2; - */ - public java.lang.String getGroupName() { - java.lang.Object ref = groupName_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - groupName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string groupName = 2; - */ - public com.google.protobuf.ByteString - getGroupNameBytes() { - java.lang.Object ref = groupName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - groupName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string groupName = 2; - */ - public Builder setGroupName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - groupName_ = value; - onChanged(); - return this; - } - /** - * optional string groupName = 2; - */ - public Builder clearGroupName() { - bitField0_ = (bitField0_ & ~0x00000002); - groupName_ = getDefaultInstance().getGroupName(); - onChanged(); - return this; - } - /** - * optional string groupName = 2; - */ - public Builder setGroupNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - groupName_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:signalservice.OpenGroupInvitation) - } - - static { - defaultInstance = new OpenGroupInvitation(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:signalservice.OpenGroupInvitation) - } - public interface ConfigurationMessageOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -21008,6 +21132,11 @@ public final class SignalServiceProtos { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_signalservice_DataMessage_LokiProfile_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_signalservice_DataMessage_OpenGroupInvitation_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_signalservice_DataMessage_OpenGroupInvitation_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_signalservice_DataMessage_ClosedGroupControlMessage_descriptor; private static @@ -21018,11 +21147,6 @@ public final class SignalServiceProtos { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_signalservice_DataMessage_ClosedGroupControlMessage_KeyPairWrapper_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_signalservice_OpenGroupInvitation_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_signalservice_OpenGroupInvitation_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_signalservice_ConfigurationMessage_descriptor; private static @@ -21071,7 +21195,7 @@ public final class SignalServiceProtos { "SSAGE\020\007\"{\n\rTypingMessage\022\021\n\ttimestamp\030\001 " + "\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\"\371\002\n\007Content\022/\n\013dataMessage\030", + "\013\n\007STOPPED\020\001\"\270\002\n\007Content\022/\n\013dataMessage\030", "\001 \001(\0132\032.signalservice.DataMessage\0225\n\016rec" + "eiptMessage\030\005 \001(\0132\035.signalservice.Receip" + "tMessage\0223\n\rtypingMessage\030\006 \001(\0132\034.signal" + @@ -21079,79 +21203,79 @@ public final class SignalServiceProtos { "ssage\030\007 \001(\0132#.signalservice.Configuratio" + "nMessage\022M\n\032dataExtractionNotification\030\010" + " \001(\0132).signalservice.DataExtractionNotif" + - "ication\022?\n\023openGroupInvitation\030\t \001(\0132\".s" + - "ignalservice.OpenGroupInvitation\"0\n\007KeyP" + - "air\022\021\n\tpublicKey\030\001 \002(\014\022\022\n\nprivateKey\030\002 \002", - "(\014\"\226\001\n\032DataExtractionNotification\022<\n\004typ" + - "e\030\001 \002(\0162..signalservice.DataExtractionNo" + - "tification.Type\022\021\n\ttimestamp\030\002 \001(\004\"\'\n\004Ty" + - "pe\022\016\n\nSCREENSHOT\020\001\022\017\n\013MEDIA_SAVED\020\002\"\215\013\n\013" + - "DataMessage\022\014\n\004body\030\001 \001(\t\0225\n\013attachments" + - "\030\002 \003(\0132 .signalservice.AttachmentPointer" + - "\022*\n\005group\030\003 \001(\0132\033.signalservice.GroupCon" + - "text\022\r\n\005flags\030\004 \001(\r\022\023\n\013expireTimer\030\005 \001(\r" + - "\022\022\n\nprofileKey\030\006 \001(\014\022\021\n\ttimestamp\030\007 \001(\004\022" + - "/\n\005quote\030\010 \001(\0132 .signalservice.DataMessa", - "ge.Quote\0223\n\007preview\030\n \003(\0132\".signalservic" + - "e.DataMessage.Preview\0227\n\007profile\030e \001(\0132&" + - ".signalservice.DataMessage.LokiProfile\022W" + - "\n\031closedGroupControlMessage\030h \001(\01324.sign" + - "alservice.DataMessage.ClosedGroupControl" + - "Message\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\022" + - "F\n\013attachments\030\004 \003(\01321.signalservice.Dat" + - "aMessage.Quote.QuotedAttachment\032\231\001\n\020Quot" + - "edAttachment\022\023\n\013contentType\030\001 \001(\t\022\020\n\010fil", - "eName\030\002 \001(\t\0223\n\tthumbnail\030\003 \001(\0132 .signals" + - "ervice.AttachmentPointer\022\r\n\005flags\030\004 \001(\r\"" + - "\032\n\005Flags\022\021\n\rVOICE_MESSAGE\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.AttachmentPointer\032:\n\013L" + - "okiProfile\022\023\n\013displayName\030\001 \001(\t\022\026\n\016profi" + - "lePicture\030\002 \001(\t\032\343\003\n\031ClosedGroupControlMe" + - "ssage\022G\n\004type\030\001 \002(\01629.signalservice.Data" + - "Message.ClosedGroupControlMessage.Type\022\021" + - "\n\tpublicKey\030\002 \001(\014\022\014\n\004name\030\003 \001(\t\0221\n\021encry", - "ptionKeyPair\030\004 \001(\0132\026.signalservice.KeyPa" + - "ir\022\017\n\007members\030\005 \003(\014\022\016\n\006admins\030\006 \003(\014\022U\n\010w" + - "rappers\030\007 \003(\0132C.signalservice.DataMessag" + - "e.ClosedGroupControlMessage.KeyPairWrapp" + - "er\032=\n\016KeyPairWrapper\022\021\n\tpublicKey\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_CHAN" + - "GE\020\004\022\021\n\rMEMBERS_ADDED\020\005\022\023\n\017MEMBERS_REMOV" + - "ED\020\006\022\017\n\013MEMBER_LEFT\020\007\"$\n\005Flags\022\033\n\027EXPIRA" + - "TION_TIMER_UPDATE\020\002\":\n\023OpenGroupInvitati", - "on\022\020\n\010groupUrl\030\001 \001(\t\022\021\n\tgroupName\030\002 \001(\t\"" + - "\316\003\n\024ConfigurationMessage\022E\n\014closedGroups" + - "\030\001 \003(\0132/.signalservice.ConfigurationMess" + - "age.ClosedGroup\022\022\n\nopenGroups\030\002 \003(\t\022\023\n\013d" + - "isplayName\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+" + - ".signalservice.ConfigurationMessage.Cont" + - "act\032\202\001\n\013ClosedGroup\022\021\n\tpublicKey\030\001 \001(\014\022\014" + - "\n\004name\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\032V\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\nprofileKey\030\004 \001(\014\"u\n\016ReceiptMessa" + - "ge\0220\n\004type\030\001 \002(\0162\".signalservice.Receipt" + - "Message.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\021AttachmentPo" + - "inter\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\005Fl" + - "ags\022\021\n\rVOICE_MESSAGE\020\001\"\365\001\n\014GroupContext\022" + - "\n\n\002id\030\001 \001(\014\022.\n\004type\030\002 \001(\0162 .signalservic" + - "e.GroupContext.Type\022\014\n\004name\030\003 \001(\t\022\017\n\007mem" + - "bers\030\004 \003(\t\0220\n\006avatar\030\005 \001(\0132 .signalservi" + - "ce.AttachmentPointer\022\016\n\006admins\030\006 \003(\t\"H\n\004" + - "Type\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\004BB\n+org.se" + - "ssion.libsignal.service.internal.pushB\023S" + - "ignalServiceProtos" + "ication\"0\n\007KeyPair\022\021\n\tpublicKey\030\001 \002(\014\022\022\n" + + "\nprivateKey\030\002 \002(\014\"\226\001\n\032DataExtractionNoti" + + "fication\022<\n\004type\030\001 \002(\0162..signalservice.D", + "ataExtractionNotification.Type\022\021\n\ttimest" + + "amp\030\002 \001(\004\"\'\n\004Type\022\016\n\nSCREENSHOT\020\001\022\017\n\013MED" + + "IA_SAVED\020\002\"\214\014\n\013DataMessage\022\014\n\004body\030\001 \001(\t" + + "\0225\n\013attachments\030\002 \003(\0132 .signalservice.At" + + "tachmentPointer\022*\n\005group\030\003 \001(\0132\033.signals" + + "ervice.GroupContext\022\r\n\005flags\030\004 \001(\r\022\023\n\013ex" + + "pireTimer\030\005 \001(\r\022\022\n\nprofileKey\030\006 \001(\014\022\021\n\tt" + + "imestamp\030\007 \001(\004\022/\n\005quote\030\010 \001(\0132 .signalse" + + "rvice.DataMessage.Quote\0223\n\007preview\030\n \003(\013" + + "2\".signalservice.DataMessage.Preview\0227\n\007", + "profile\030e \001(\0132&.signalservice.DataMessag" + + "e.LokiProfile\022K\n\023openGroupInvitation\030f \001" + + "(\0132..signalservice.DataMessage.OpenGroup" + + "Invitation\022W\n\031closedGroupControlMessage\030" + + "h \001(\01324.signalservice.DataMessage.Closed" + + "GroupControlMessage\022\022\n\nsyncTarget\030i \001(\t\032" + + "\225\002\n\005Quote\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\022\014\n" + + "\004text\030\003 \001(\t\022F\n\013attachments\030\004 \003(\01321.signa" + + "lservice.DataMessage.Quote.QuotedAttachm" + + "ent\032\231\001\n\020QuotedAttachment\022\023\n\013contentType\030", + "\001 \001(\t\022\020\n\010fileName\030\002 \001(\t\0223\n\tthumbnail\030\003 \001" + + "(\0132 .signalservice.AttachmentPointer\022\r\n\005" + + "flags\030\004 \001(\r\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\032" + + "V\n\007Preview\022\013\n\003url\030\001 \002(\t\022\r\n\005title\030\002 \001(\t\022/" + + "\n\005image\030\003 \001(\0132 .signalservice.Attachment" + + "Pointer\032:\n\013LokiProfile\022\023\n\013displayName\030\001 " + + "\001(\t\022\026\n\016profilePicture\030\002 \001(\t\0320\n\023OpenGroup" + + "Invitation\022\013\n\003url\030\001 \002(\t\022\014\n\004name\030\003 \002(\t\032\343\003" + + "\n\031ClosedGroupControlMessage\022G\n\004type\030\001 \002(" + + "\01629.signalservice.DataMessage.ClosedGrou", + "pControlMessage.Type\022\021\n\tpublicKey\030\002 \001(\014\022" + + "\014\n\004name\030\003 \001(\t\0221\n\021encryptionKeyPair\030\004 \001(\013" + + "2\026.signalservice.KeyPair\022\017\n\007members\030\005 \003(" + + "\014\022\016\n\006admins\030\006 \003(\014\022U\n\010wrappers\030\007 \003(\0132C.si" + + "gnalservice.DataMessage.ClosedGroupContr" + + "olMessage.KeyPairWrapper\032=\n\016KeyPairWrapp" + + "er\022\021\n\tpublicKey\030\001 \002(\014\022\030\n\020encryptedKeyPai" + + "r\030\002 \002(\014\"r\n\004Type\022\007\n\003NEW\020\001\022\027\n\023ENCRYPTION_K" + + "EY_PAIR\020\003\022\017\n\013NAME_CHANGE\020\004\022\021\n\rMEMBERS_AD" + + "DED\020\005\022\023\n\017MEMBERS_REMOVED\020\006\022\017\n\013MEMBER_LEF", + "T\020\007\"$\n\005Flags\022\033\n\027EXPIRATION_TIMER_UPDATE\020" + + "\002\"\316\003\n\024ConfigurationMessage\022E\n\014closedGrou" + + "ps\030\001 \003(\0132/.signalservice.ConfigurationMe" + + "ssage.ClosedGroup\022\022\n\nopenGroups\030\002 \003(\t\022\023\n" + + "\013displayName\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(\013" + + "2+.signalservice.ConfigurationMessage.Co" + + "ntact\032\202\001\n\013ClosedGroup\022\021\n\tpublicKey\030\001 \001(\014" + + "\022\014\n\004name\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\032V\n\007Contact\022\021\n\tpublicK" + + "ey\030\001 \002(\014\022\014\n\004name\030\002 \002(\t\022\026\n\016profilePicture" + + "\030\003 \001(\t\022\022\n\nprofileKey\030\004 \001(\014\"u\n\016ReceiptMes" + + "sage\0220\n\004type\030\001 \002(\0162\".signalservice.Recei" + + "ptMessage.Type\022\021\n\ttimestamp\030\002 \003(\004\"\036\n\004Typ" + + "e\022\014\n\010DELIVERY\020\000\022\010\n\004READ\020\001\"\354\001\n\021Attachment" + + "Pointer\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\005" + + "Flags\022\021\n\rVOICE_MESSAGE\020\001\"\365\001\n\014GroupContex" + + "t\022\n\n\002id\030\001 \001(\014\022.\n\004type\030\002 \001(\0162 .signalserv" + + "ice.GroupContext.Type\022\014\n\004name\030\003 \001(\t\022\017\n\007m" + + "embers\030\004 \003(\t\0220\n\006avatar\030\005 \001(\0132 .signalser" + + "vice.AttachmentPointer\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\007DELIV" + + "ER\020\002\022\010\n\004QUIT\020\003\022\020\n\014REQUEST_INFO\020\004BB\n+org." + + "session.libsignal.service.internal.pushB" + + "\023SignalServiceProtos" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -21175,7 +21299,7 @@ public final class SignalServiceProtos { internal_static_signalservice_Content_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_Content_descriptor, - new java.lang.String[] { "DataMessage", "ReceiptMessage", "TypingMessage", "ConfigurationMessage", "DataExtractionNotification", "OpenGroupInvitation", }); + new java.lang.String[] { "DataMessage", "ReceiptMessage", "TypingMessage", "ConfigurationMessage", "DataExtractionNotification", }); internal_static_signalservice_KeyPair_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_signalservice_KeyPair_fieldAccessorTable = new @@ -21193,7 +21317,7 @@ public final class SignalServiceProtos { internal_static_signalservice_DataMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_DataMessage_descriptor, - new java.lang.String[] { "Body", "Attachments", "Group", "Flags", "ExpireTimer", "ProfileKey", "Timestamp", "Quote", "Preview", "Profile", "ClosedGroupControlMessage", "SyncTarget", }); + new java.lang.String[] { "Body", "Attachments", "Group", "Flags", "ExpireTimer", "ProfileKey", "Timestamp", "Quote", "Preview", "Profile", "OpenGroupInvitation", "ClosedGroupControlMessage", "SyncTarget", }); internal_static_signalservice_DataMessage_Quote_descriptor = internal_static_signalservice_DataMessage_descriptor.getNestedTypes().get(0); internal_static_signalservice_DataMessage_Quote_fieldAccessorTable = new @@ -21218,8 +21342,14 @@ public final class SignalServiceProtos { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_DataMessage_LokiProfile_descriptor, new java.lang.String[] { "DisplayName", "ProfilePicture", }); - internal_static_signalservice_DataMessage_ClosedGroupControlMessage_descriptor = + internal_static_signalservice_DataMessage_OpenGroupInvitation_descriptor = internal_static_signalservice_DataMessage_descriptor.getNestedTypes().get(3); + internal_static_signalservice_DataMessage_OpenGroupInvitation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_signalservice_DataMessage_OpenGroupInvitation_descriptor, + new java.lang.String[] { "Url", "Name", }); + internal_static_signalservice_DataMessage_ClosedGroupControlMessage_descriptor = + internal_static_signalservice_DataMessage_descriptor.getNestedTypes().get(4); internal_static_signalservice_DataMessage_ClosedGroupControlMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_DataMessage_ClosedGroupControlMessage_descriptor, @@ -21230,14 +21360,8 @@ public final class SignalServiceProtos { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_DataMessage_ClosedGroupControlMessage_KeyPairWrapper_descriptor, new java.lang.String[] { "PublicKey", "EncryptedKeyPair", }); - internal_static_signalservice_OpenGroupInvitation_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_signalservice_OpenGroupInvitation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_signalservice_OpenGroupInvitation_descriptor, - new java.lang.String[] { "GroupUrl", "GroupName", }); internal_static_signalservice_ConfigurationMessage_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(6); internal_static_signalservice_ConfigurationMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_ConfigurationMessage_descriptor, @@ -21255,19 +21379,19 @@ public final class SignalServiceProtos { internal_static_signalservice_ConfigurationMessage_Contact_descriptor, new java.lang.String[] { "PublicKey", "Name", "ProfilePicture", "ProfileKey", }); internal_static_signalservice_ReceiptMessage_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(7); internal_static_signalservice_ReceiptMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_ReceiptMessage_descriptor, new java.lang.String[] { "Type", "Timestamp", }); internal_static_signalservice_AttachmentPointer_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(8); internal_static_signalservice_AttachmentPointer_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_AttachmentPointer_descriptor, new java.lang.String[] { "Id", "ContentType", "Key", "Size", "Thumbnail", "Digest", "FileName", "Flags", "Width", "Height", "Caption", "Url", }); internal_static_signalservice_GroupContext_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(9); internal_static_signalservice_GroupContext_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_signalservice_GroupContext_descriptor,