chore: Update to FOSS 1.11.31 (MESSENGER-7610)

Merge commit '822cbc5076da248fa7b997a5e3e906b03c4a09f7' into feature/7610_FOSS_Merge_1_11_31

# Conflicts:
#	Config/AppVersion.xcconfig
#	Podfile
#	Podfile.lock
#	README.md
#	Riot/Modules/Common/Recents/RecentsViewController.m
#	Riot/Modules/ContextMenu/Services/RoomContextActionService.swift
#	Riot/Modules/Room/Members/RoomParticipantsViewController.m
#	Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift
#	fastlane/Fastfile
This commit is contained in:
Frank Rotermund
2025-08-27 07:39:26 +02:00
61 changed files with 1278 additions and 363 deletions
@@ -102,6 +102,18 @@ final class RoomInfoListViewController: UIViewController {
return self.doNotLeaveUIAlertController()
}
}
private lazy var isLastOwnerAlertController: UIAlertController = {
let title = VectorL10n.error
let message = VectorL10n.roomParticipantsLeaveNotAllowedForLastOwnerMsg
let controller = UIAlertController(title: title, message: message, preferredStyle: .alert)
controller.addAction(UIAlertAction(title: VectorL10n.ok, style: .default, handler: nil))
controller.mxk_setAccessibilityIdentifier("RoomSettingsVCLastOwnerAlert")
return controller
}()
private enum RowType {
case `default`
@@ -267,8 +279,11 @@ final class RoomInfoListViewController: UIViewController {
VectorL10n.roomParticipantsLeavePromptTitleForDm :
VectorL10n.roomParticipantsLeavePromptTitle
let rowLeave = Row(type: .destructive, icon: Asset.Images.roomActionLeave.image, text: leaveTitle, accessoryType: .none) {
if BWIBuildSettings.shared.lastAdminIsNotAllowedToLeaveRoom {
self.present(self.getLeaveAlertController(), animated: true, completion: nil)
} else if viewData.isLastOwner {
self.present(self.isLastOwnerAlertController, animated: true, completion: nil)
} else {
self.present(self.leaveAlertController, animated: true, completion: nil)
}
@@ -24,4 +24,5 @@ struct RoomInfoListViewData {
let isEncrypted: Bool
let isDirect: Bool
let basicInfoViewData: RoomInfoBasicViewData
let isLastOwner: Bool
}
@@ -27,6 +27,7 @@ final class RoomInfoListViewModel: NSObject, RoomInfoListViewModelType {
private let session: MXSession
private let room: MXRoom
private var isLastOwner = false
// MARK: Public
@@ -70,7 +71,8 @@ final class RoomInfoListViewModel: NSObject, RoomInfoListViewModelType {
return RoomInfoListViewData(numberOfMembers: Int(room.summary.membersCount.joined),
isEncrypted: room.summary.isEncrypted,
isDirect: room.isDirect,
basicInfoViewData: basicInfoViewData)
basicInfoViewData: basicInfoViewData,
isLastOwner: isLastOwner)
}
// bwi: 5216 - federation
@@ -163,6 +165,9 @@ final class RoomInfoListViewModel: NSObject, RoomInfoListViewModelType {
@objc private func roomSummaryUpdated(_ notification: Notification) {
// force update view
self.update(viewState: .loaded(viewData: viewData))
Task {
isLastOwner = (try? await room.isLastOwner()) == true
}
}
private func loadData() {