mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 18:12:44 +02:00
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:
@@ -220,20 +220,47 @@ Please see LICENSE in the repository root for full details.
|
||||
}
|
||||
case MXKRoomMemberDetailsActionLeave:
|
||||
{
|
||||
[self addPendingActionMask];
|
||||
[self.mxRoom leave:^{
|
||||
|
||||
[self removePendingActionMask];
|
||||
[self withdrawViewControllerAnimated:YES completion:nil];
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
[self removePendingActionMask];
|
||||
MXLogDebug(@"[MXKRoomMemberDetailsVC] Leave room %@ failed", self->mxRoom.roomId);
|
||||
// Notify MatrixKit user
|
||||
NSString *myUserId = self.mainSession.myUser.userId;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error userInfo:myUserId ? @{kMXKErrorUserIdKey: myUserId} : nil];
|
||||
|
||||
MXWeakify(self);
|
||||
[self.mxRoom isLastOwnerWithCompletionHandler:^(BOOL isLastOwner, NSError* error){
|
||||
if (isLastOwner)
|
||||
{
|
||||
UIAlertController *isLastOwnerPrompt = [UIAlertController alertControllerWithTitle:[VectorL10n error]
|
||||
message:[VectorL10n roomParticipantsLeaveNotAllowedForLastOwnerMsg]
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[isLastOwnerPrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
self->currentAlert = nil;
|
||||
}]];
|
||||
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self presentViewController:isLastOwnerPrompt animated:YES completion:nil];
|
||||
self->currentAlert = isLastOwnerPrompt;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
[self addPendingActionMask];
|
||||
MXWeakify(self);
|
||||
[self.mxRoom leave:^{
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
[self removePendingActionMask];
|
||||
[self withdrawViewControllerAnimated:YES completion:nil];
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
[self removePendingActionMask];
|
||||
MXLogDebug(@"[MXKRoomMemberDetailsVC] Leave room %@ failed", self->mxRoom.roomId);
|
||||
// Notify MatrixKit user
|
||||
NSString *myUserId = self.mainSession.myUser.userId;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error userInfo:myUserId ? @{kMXKErrorUserIdKey: myUserId} : nil];
|
||||
|
||||
}];
|
||||
}
|
||||
}];
|
||||
break;
|
||||
}
|
||||
@@ -639,9 +666,10 @@ Please see LICENSE in the repository root for full details.
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
// Check user's power level before allowing an action (kick, ban, ...)
|
||||
MXRoomState *roomState = self.mxRoomLiveTimeline.state;
|
||||
MXRoomPowerLevels *powerLevels = [self.mxRoomLiveTimeline.state powerLevels];
|
||||
NSInteger memberPowerLevel = [powerLevels powerLevelOfUserWithUserID:_mxRoomMember.userId];
|
||||
NSInteger oneSelfPowerLevel = [powerLevels powerLevelOfUserWithUserID:self.mainSession.myUser.userId];
|
||||
NSInteger memberPowerLevel = [roomState powerLevelOfUserWithUserID:_mxRoomMember.userId];
|
||||
NSInteger oneSelfPowerLevel = [roomState powerLevelOfUserWithUserID:self.mainSession.myUser.userId];
|
||||
|
||||
[actionsArray removeAllObjects];
|
||||
|
||||
@@ -894,14 +922,14 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
- (void)setPowerLevel:(NSInteger)value promptUser:(BOOL)promptUser
|
||||
{
|
||||
NSInteger currentPowerLevel = [self.mxRoomLiveTimeline.state.powerLevels powerLevelOfUserWithUserID:_mxRoomMember.userId];
|
||||
NSInteger currentPowerLevel = [self.mxRoomLiveTimeline.state powerLevelOfUserWithUserID:_mxRoomMember.userId];
|
||||
|
||||
// check if the power level has not yet been set to 0
|
||||
if (value != currentPowerLevel)
|
||||
{
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
if (promptUser && value == [self.mxRoomLiveTimeline.state.powerLevels powerLevelOfUserWithUserID:self.mainSession.myUser.userId])
|
||||
if (promptUser && value == [self.mxRoomLiveTimeline.state powerLevelOfUserWithUserID:self.mainSession.myUser.userId])
|
||||
{
|
||||
// If the user is setting the same power level as his to another user, ask him for a confirmation
|
||||
if (currentAlert)
|
||||
@@ -999,7 +1027,7 @@ Please see LICENSE in the repository root for full details.
|
||||
typeof(self) self = weakSelf;
|
||||
|
||||
textField.secureTextEntry = NO;
|
||||
textField.text = [NSString stringWithFormat:@"%ld", (long)[self.mxRoomLiveTimeline.state.powerLevels powerLevelOfUserWithUserID:self.mxRoomMember.userId]];
|
||||
textField.text = [NSString stringWithFormat:@"%ld", (long)[self.mxRoomLiveTimeline.state powerLevelOfUserWithUserID:self.mxRoomMember.userId]];
|
||||
textField.placeholder = nil;
|
||||
textField.keyboardType = UIKeyboardTypeDecimalPad;
|
||||
}];
|
||||
|
||||
@@ -307,7 +307,7 @@ Please see LICENSE in the repository root for full details.
|
||||
if (showInvitationOption && self->dataSource)
|
||||
{
|
||||
// Check conditions to be able to invite someone
|
||||
NSInteger oneSelfPowerLevel = [roomState.powerLevels powerLevelOfUserWithUserID:self.mainSession.myUser.userId];
|
||||
NSInteger oneSelfPowerLevel = [roomState powerLevelOfUserWithUserID:self.mainSession.myUser.userId];
|
||||
if (oneSelfPowerLevel < [roomState.powerLevels invite])
|
||||
{
|
||||
showInvitationOption = NO;
|
||||
|
||||
Reference in New Issue
Block a user