Feature/2581 permalinks

This commit is contained in:
Frank Rotermund
2022-03-31 05:51:40 +00:00
parent d0203ecec4
commit 61d260a8e0
17 changed files with 168 additions and 29 deletions
@@ -664,6 +664,11 @@
// Add mention option
[otherActionsArray addObject:@(MXKRoomMemberDetailsActionMention)];
}
if (BwiBuildSettings.bwiAllowUserPermalink)
{
[otherActionsArray addObject:@(MXKRoomMemberDetailsActionPermalink)];
}
}
if (self.mxRoom.summary.isEncrypted)
@@ -821,6 +826,9 @@
case MXKRoomMemberDetailsActionMention:
title = [VectorL10n roomParticipantsActionMention];
break;
case MXKRoomMemberDetailsActionPermalink:
title = [VectorL10n roomParticipantsActionPermalink];
break;
default:
break;
}
@@ -1276,6 +1284,11 @@
[self presentViewController:currentAlert animated:YES completion:nil];
break;
}
case MXKRoomMemberDetailsActionPermalink:
{
[self createPermalink];
break;
}
default:
{
[super onActionButtonPressed:sender];
@@ -1305,6 +1318,21 @@
return numOtherAdmins > 0 ? FALSE : TRUE;
}
- (void) createPermalink {
NSString *permalink = [MXTools permalinkToUserWithUserId:self.mxRoomMember.userId];
NSURL *url = [NSURL URLWithString:permalink];
if (url)
{
MXKPasteboardManager.shared.pasteboard.URL = url;
[self.view vc_toastWithMessage:VectorL10n.roomEventCopyLinkInfo
image:[UIImage imageNamed:@"link_icon"]
duration:2.0
position:ToastPositionBottom
additionalMargin:0];
}
}
- (void)showAlertChangePowerLevelNotAllowed {
__weak typeof(self) weakSelf = self;