handleOpenGroupInvitation skeleton added + region added

This commit is contained in:
Brice-W 2021-04-30 16:09:11 +10:00
parent 99a62d9e99
commit 9ee167c173

View File

@ -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)
}
}
//endregion