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
@@ -796,8 +796,8 @@ Please see LICENSE in the repository root for full details.
{
// Order first by power levels (admins then moderators then others)
MXRoomPowerLevels *powerLevels = [roomState powerLevels];
NSInteger powerLevelA = [powerLevels powerLevelOfUserWithUserID:contactA.mxMember.userId];
NSInteger powerLevelB = [powerLevels powerLevelOfUserWithUserID:contactB.mxMember.userId];
NSInteger powerLevelA = [roomState powerLevelOfUserWithUserID:contactA.mxMember.userId];
NSInteger powerLevelB = [roomState powerLevelOfUserWithUserID:contactB.mxMember.userId];
if (powerLevelA == powerLevelB)
{
@@ -1099,6 +1099,9 @@ Please see LICENSE in the repository root for full details.
NSString *powerLevelText;
switch (roomPowerLevel) {
case RoomPowerLevelOwner:
powerLevelText = [VectorL10n roomMemberPowerLevelShortOwner];
break;
case RoomPowerLevelAdmin:
powerLevelText = [VectorL10n roomMemberPowerLevelShortAdmin];
break;
@@ -1309,62 +1312,7 @@ Please see LICENSE in the repository root for full details.
if (section == participantsSection && userParticipant && (0 == row) && !currentSearchText.length)
{
// Leave ?
MXWeakify(self);
NSString *title, *message;
if (self.mxRoom.isDirect)
{
title = [VectorL10n roomParticipantsLeavePromptTitleForDm];
message = [VectorL10n roomParticipantsLeavePromptMsgForDm];
}
else
{
title = [VectorL10n roomParticipantsLeavePromptTitle];
message = [VectorL10n roomParticipantsLeavePromptMsg];
}
currentAlert = [UIAlertController alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleAlert];
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
}]];
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n leave]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
[self addPendingActionMask];
MXWeakify(self);
[self.mxRoom leave:^{
MXStrongifyAndReturnIfNil(self);
[self withdrawViewControllerAnimated:YES completion:nil];
} failure:^(NSError *error) {
MXStrongifyAndReturnIfNil(self);
[self removePendingActionMask];
MXLogDebug(@"[RoomParticipantsVC] Leave room %@ failed", self.mxRoom.roomId);
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
}];
}]];
[currentAlert mxk_setAccessibilityIdentifier:@"RoomParticipantsVCLeaveAlert"];
[self presentViewController:currentAlert animated:YES completion:nil];
[self leaveRoom];
}
else
{
@@ -1511,6 +1459,90 @@ Please see LICENSE in the repository root for full details.
}
}
- (void)leaveRoom {
MXWeakify(self);
[self.mxRoom isLastOwnerWithCompletionHandler:^(BOOL isLastOwner, NSError* error) {
if (isLastOwner)
{
MXStrongifyAndReturnIfNil(self);
self->currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n error]
message:[VectorL10n roomParticipantsLeaveNotAllowedForLastOwnerMsg]
preferredStyle:UIAlertControllerStyleAlert];
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
}]];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:self->currentAlert animated:YES completion:nil];
});
}
else
{
// Leave ?
MXStrongifyAndReturnIfNil(self);
NSString *title, *message;
if (self.mxRoom.isDirect)
{
title = [VectorL10n roomParticipantsLeavePromptTitleForDm];
message = [VectorL10n roomParticipantsLeavePromptMsgForDm];
}
else
{
title = [VectorL10n roomParticipantsLeavePromptTitle];
message = [VectorL10n roomParticipantsLeavePromptMsg];
}
self->currentAlert = [UIAlertController alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleAlert];
MXWeakify(self);
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
}]];
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n leave]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
[self addPendingActionMask];
MXWeakify(self);
[self.mxRoom leave:^{
MXStrongifyAndReturnIfNil(self);
[self withdrawViewControllerAnimated:YES completion:nil];
} failure:^(NSError *error) {
MXStrongifyAndReturnIfNil(self);
[self removePendingActionMask];
MXLogDebug(@"[RoomParticipantsVC] Leave room %@ failed", self.mxRoom.roomId);
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
}];
}]];
[self->currentAlert mxk_setAccessibilityIdentifier:@"RoomParticipantsVCLeaveAlert"];
[self presentViewController:self->currentAlert animated:YES completion:nil];
}
}];
}
- (void)onCancel:(id)sender
{
[self withdrawViewControllerAnimated:YES completion:nil];