From 9ee167c1737aab23012f6dcfc3d4881e79206d26 Mon Sep 17 00:00:00 2001 From: Brice-W Date: Fri, 30 Apr 2021 16:09:11 +1000 Subject: [PATCH] handleOpenGroupInvitation skeleton added + region added --- .../ReceivedMessageHandler.kt | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 34da1396b7..5ddc1a7a62 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 @@ -48,10 +48,13 @@ 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) } } +//region ControlMessage + private fun MessageReceiver.handleReadReceipt(message: ReadReceipt) { val context = MessagingModuleConfiguration.shared.context SSKEnvironment.shared.readReceiptManager.processReadReceipts(context, message.sender!!, message.timestamps!!, message.receivedTimestamp!!) @@ -145,6 +148,18 @@ private fun handleConfigurationMessage(message: ConfigurationMessage) { storage.addContacts(message.contacts) } +// Open group invitation handling + +fun handleOpenGroupInvitation(message: OpenGroupInvitation) { + //TODO +} + +//endregion + +//region VisibleMessage + +// Visible message handling + fun MessageReceiver.handleVisibleMessage(message: VisibleMessage, proto: SignalServiceProtos.Content, openGroupID: String?) { val storage = MessagingModuleConfiguration.shared.storage val context = MessagingModuleConfiguration.shared.context @@ -228,6 +243,10 @@ fun MessageReceiver.handleVisibleMessage(message: VisibleMessage, proto: SignalS SSKEnvironment.shared.notificationManager.updateNotification(context, threadID) } +//endregion + +//region ClosedGroupControlMessage + private fun MessageReceiver.handleClosedGroupControlMessage(message: ClosedGroupControlMessage) { when (message.kind!!) { is ClosedGroupControlMessage.Kind.New -> handleNewClosedGroup(message) @@ -562,4 +581,6 @@ fun MessageReceiver.disableLocalGroupAndUnsubscribe(groupPublicKey: String, grou storage.removeMember(groupID, Address.fromSerialized(userPublicKey)) // Notify the PN server PushNotificationAPI.performOperation(PushNotificationAPI.ClosedGroupOperation.Unsubscribe, groupPublicKey, userPublicKey) -} \ No newline at end of file +} + +//endregion