mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 20:15:21 +00:00
fix: handle group of size 1 being destroyed locally for admin
This commit is contained in:
parent
c740963fe2
commit
766266d54d
@ -509,7 +509,8 @@ object ClosedGroupsProtocolV2 {
|
|||||||
val updatedMemberList = members - senderPublicKey
|
val updatedMemberList = members - senderPublicKey
|
||||||
val userLeft = userPublicKey == senderPublicKey
|
val userLeft = userPublicKey == senderPublicKey
|
||||||
|
|
||||||
if (didAdminLeave || userLeft) {
|
// if the admin left, we left, or we are the only remaining member: remove the group
|
||||||
|
if (didAdminLeave || userLeft || updatedMemberList.size == 1) {
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user