mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Feature/2581 permalinks
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user