mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 13:08:25 +00:00
handleOpenGroupInvitation skeleton added + region added
This commit is contained in:
parent
99a62d9e99
commit
9ee167c173
@ -48,10 +48,13 @@ fun MessageReceiver.handle(message: Message, proto: SignalServiceProtos.Content,
|
|||||||
is ExpirationTimerUpdate -> handleExpirationTimerUpdate(message)
|
is ExpirationTimerUpdate -> handleExpirationTimerUpdate(message)
|
||||||
is DataExtractionNotification -> handleDataExtractionNotification(message)
|
is DataExtractionNotification -> handleDataExtractionNotification(message)
|
||||||
is ConfigurationMessage -> handleConfigurationMessage(message)
|
is ConfigurationMessage -> handleConfigurationMessage(message)
|
||||||
|
is OpenGroupInvitation -> handleOpenGroupInvitation(message)
|
||||||
is VisibleMessage -> handleVisibleMessage(message, proto, openGroupID)
|
is VisibleMessage -> handleVisibleMessage(message, proto, openGroupID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//region ControlMessage
|
||||||
|
|
||||||
private fun MessageReceiver.handleReadReceipt(message: ReadReceipt) {
|
private fun MessageReceiver.handleReadReceipt(message: ReadReceipt) {
|
||||||
val context = MessagingModuleConfiguration.shared.context
|
val context = MessagingModuleConfiguration.shared.context
|
||||||
SSKEnvironment.shared.readReceiptManager.processReadReceipts(context, message.sender!!, message.timestamps!!, message.receivedTimestamp!!)
|
SSKEnvironment.shared.readReceiptManager.processReadReceipts(context, message.sender!!, message.timestamps!!, message.receivedTimestamp!!)
|
||||||
@ -145,6 +148,18 @@ private fun handleConfigurationMessage(message: ConfigurationMessage) {
|
|||||||
storage.addContacts(message.contacts)
|
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?) {
|
fun MessageReceiver.handleVisibleMessage(message: VisibleMessage, proto: SignalServiceProtos.Content, openGroupID: String?) {
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
val context = MessagingModuleConfiguration.shared.context
|
val context = MessagingModuleConfiguration.shared.context
|
||||||
@ -228,6 +243,10 @@ fun MessageReceiver.handleVisibleMessage(message: VisibleMessage, proto: SignalS
|
|||||||
SSKEnvironment.shared.notificationManager.updateNotification(context, threadID)
|
SSKEnvironment.shared.notificationManager.updateNotification(context, threadID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
//region ClosedGroupControlMessage
|
||||||
|
|
||||||
private fun MessageReceiver.handleClosedGroupControlMessage(message: ClosedGroupControlMessage) {
|
private fun MessageReceiver.handleClosedGroupControlMessage(message: ClosedGroupControlMessage) {
|
||||||
when (message.kind!!) {
|
when (message.kind!!) {
|
||||||
is ClosedGroupControlMessage.Kind.New -> handleNewClosedGroup(message)
|
is ClosedGroupControlMessage.Kind.New -> handleNewClosedGroup(message)
|
||||||
@ -562,4 +581,6 @@ fun MessageReceiver.disableLocalGroupAndUnsubscribe(groupPublicKey: String, grou
|
|||||||
storage.removeMember(groupID, Address.fromSerialized(userPublicKey))
|
storage.removeMember(groupID, Address.fromSerialized(userPublicKey))
|
||||||
// Notify the PN server
|
// Notify the PN server
|
||||||
PushNotificationAPI.performOperation(PushNotificationAPI.ClosedGroupOperation.Unsubscribe, groupPublicKey, userPublicKey)
|
PushNotificationAPI.performOperation(PushNotificationAPI.ClosedGroupOperation.Unsubscribe, groupPublicKey, userPublicKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user