mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 00:02:47 +00:00
Merge pull request #265 from vector-im/vector_225
#225: Ability to copy message permalinks
This commit is contained in:
commit
00268e0193
2 changed files with 19 additions and 1 deletions
|
@ -143,6 +143,7 @@
|
|||
"room_event_action_copy" = "Copy";
|
||||
"room_event_action_share" = "Share";
|
||||
"room_event_action_redact" = "Redact";
|
||||
"room_event_action_permalink" = "Permalink";
|
||||
"room_event_action_save" = "Save";
|
||||
"room_event_action_resend" = "Resend";
|
||||
"room_event_action_delete" = "Delete";
|
||||
|
|
|
@ -1309,6 +1309,23 @@
|
|||
|
||||
}];
|
||||
}];
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_permalink", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
|
||||
// Create a permalink that is common to all Vector.im clients
|
||||
// FIXME: When available, use the prod Vector web app URL
|
||||
NSString *webAppUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlDev"];
|
||||
|
||||
NSString *permalink = [NSString stringWithFormat:@"%@/#/room/%@/%@",
|
||||
webAppUrl,
|
||||
selectedEvent.roomId,
|
||||
selectedEvent.eventId];
|
||||
|
||||
[[UIPasteboard generalPasteboard] setString:permalink];
|
||||
}];
|
||||
}
|
||||
|
||||
self.currentAlert.cancelButtonIndex = [self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"cancel", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
|
Loading…
Reference in a new issue