mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +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 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)
|
||||
} else {
|
||||
val isCurrentUserAdmin = admins.contains(userPublicKey)
|
||||
|
Loading…
x
Reference in New Issue
Block a user