mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Merge branch 'dev' of https://github.com/loki-project/session-android into refactor_clean_0
This commit is contained in:
commit
c5cc191ff3
@ -626,8 +626,9 @@ object ClosedGroupsProtocolV2 {
|
|||||||
// If admin leaves the group is disbanded
|
// If admin leaves the group is disbanded
|
||||||
val didAdminLeave = admins.contains(senderPublicKey)
|
val didAdminLeave = admins.contains(senderPublicKey)
|
||||||
val updatedMemberList = members - senderPublicKey
|
val updatedMemberList = members - senderPublicKey
|
||||||
|
val userLeft = userPublicKey == senderPublicKey
|
||||||
|
|
||||||
if (didAdminLeave) {
|
if (didAdminLeave || userLeft) {
|
||||||
disableLocalGroupAndUnsubscribe(context, apiDB, groupPublicKey, groupDB, groupID, userPublicKey)
|
disableLocalGroupAndUnsubscribe(context, apiDB, groupPublicKey, groupDB, groupID, userPublicKey)
|
||||||
} else {
|
} else {
|
||||||
val isCurrentUserAdmin = admins.contains(userPublicKey)
|
val isCurrentUserAdmin = admins.contains(userPublicKey)
|
||||||
@ -636,7 +637,8 @@ object ClosedGroupsProtocolV2 {
|
|||||||
generateAndSendNewEncryptionKeyPair(context, groupPublicKey, updatedMemberList)
|
generateAndSendNewEncryptionKeyPair(context, groupPublicKey, updatedMemberList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (userPublicKey == senderPublicKey) {
|
// Notify user
|
||||||
|
if (userLeft) {
|
||||||
val threadID = DatabaseFactory.getLokiThreadDatabase(context).getThreadID(groupID)
|
val threadID = DatabaseFactory.getLokiThreadDatabase(context).getThreadID(groupID)
|
||||||
insertOutgoingInfoMessage(context, groupID, GroupContext.Type.QUIT, name, members, admins, threadID, sentTimestamp)
|
insertOutgoingInfoMessage(context, groupID, GroupContext.Type.QUIT, name, members, admins, threadID, sentTimestamp)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user