Add copy Session ID button to conversation settings

This commit is contained in:
nielsandriesse 2020-09-16 10:50:48 +10:00
parent 4b95781dd9
commit 92bbc73271
1 changed files with 19 additions and 0 deletions

View File

@ -392,6 +392,20 @@ const CGFloat kIconViewLength = 24;
* ========
*/
if ([self.thread isKindOfClass:TSContactThread.class]) {
[mainSection addItem:[OWSTableItem
itemWithCustomCellBlock:^{
return [weakSelf
disclosureCellWithName:@"Copy Session ID"
iconName:@"ic_copy"
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(
OWSConversationSettingsViewController, @"copy_session_id")];
}
actionBlock:^{
[weakSelf copySessionID];
}]];
}
[mainSection addItem:[OWSTableItem
itemWithCustomCellBlock:^{
return [weakSelf
@ -1391,6 +1405,11 @@ const CGFloat kIconViewLength = 24;
[self updateTableContents];
}
- (void)copySessionID
{
UIPasteboard.generalPasteboard.string = self.thread.contactIdentifier;
}
- (void)showMediaGallery
{
OWSLogDebug(@"");