mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 18:42:47 +02:00
add checks for federated flag for room
This commit is contained in:
+22
-15
@@ -318,23 +318,30 @@ extension ContactsPickerViewModel: ContactsTableViewControllerDelegate {
|
||||
if let identifiere = identifieres.first as? String {
|
||||
// Check if user is federated
|
||||
if room.isRoomMemberFederated(identifiere) {
|
||||
// Get current serverACL settings for room
|
||||
room.getCurrentRoomServerACLSettings { serverACL in
|
||||
if let serverACL = serverACL {
|
||||
if serverACL.elementsEqual("*") {
|
||||
// Federation is active
|
||||
canInvite = true
|
||||
} else {
|
||||
// Federation is deactivated
|
||||
self.coordinatorDelegate?.contactsPickerViewModel(self, display: "", title: BWIL10n.roomParticipantsInvitePromptFederationForRoomNotAllowedText, actions: [
|
||||
UIAlertAction(title: VectorL10n.ok, style: .cancel)
|
||||
])
|
||||
// Check if room federation flag "isFederated" is true
|
||||
room.getFederatedFlag { isFederated in
|
||||
if isFederated {
|
||||
// Get current serverACL settings for room
|
||||
self.room.getCurrentRoomServerACLSettings { serverACL in
|
||||
if let serverACL = serverACL {
|
||||
if serverACL.elementsEqual("*") {
|
||||
// Federation is active
|
||||
canInvite = true
|
||||
} else {
|
||||
// Federation is deactivated
|
||||
self.coordinatorDelegate?.contactsPickerViewModel(self, display: "", title: BWIL10n.roomParticipantsInvitePromptFederationForRoomNotAllowedText, actions:
|
||||
[UIAlertAction(title: VectorL10n.ok, style: .cancel)])
|
||||
}
|
||||
} else {
|
||||
// ServerACL not configured
|
||||
self.coordinatorDelegate?.contactsPickerViewModel(self, display: "", title: BWIL10n.roomParticipantsInvitePromptServerAclForRoomNotConfiguredText, actions:
|
||||
[UIAlertAction(title: VectorL10n.ok, style: .cancel)])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// ServerACL not configured
|
||||
self.coordinatorDelegate?.contactsPickerViewModel(self, display: "", title: BWIL10n.roomParticipantsInvitePromptServerAclForRoomNotConfiguredText, actions: [
|
||||
UIAlertAction(title: VectorL10n.ok, style: .cancel)
|
||||
])
|
||||
// Federation is deactivated
|
||||
self.coordinatorDelegate?.contactsPickerViewModel(self, display: "", title: BWIL10n.roomParticipantsInvitePromptFederationForRoomNotAllowedText, actions:
|
||||
[UIAlertAction(title: VectorL10n.ok, style: .cancel)])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user