mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
feat: change leave room info last admin (MESSENGER-5783)
This commit is contained in:
@@ -28,6 +28,7 @@ final class LeaveRoomHelper {
|
||||
}
|
||||
|
||||
var canLeave = false
|
||||
var hasInvites = false
|
||||
|
||||
// admins can only leave if there is at least one other admin
|
||||
room.state { (state) in
|
||||
@@ -39,9 +40,12 @@ final class LeaveRoomHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
if state?.membersCount.invited ?? 0 > 0 {
|
||||
hasInvites = true
|
||||
}
|
||||
}
|
||||
// A single admin can leave the room if he is the only member
|
||||
if !canLeave && self.isOnlyMember(room) {
|
||||
// A single admin can leave the room if he is the only member and there are no pending invites. User can leave DMs without a rule.
|
||||
if !canLeave && self.isOnlyMember(room) && !hasInvites || room.isDirect {
|
||||
canLeave = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user