|
|
@ -649,8 +649,13 @@ const CGFloat kIconViewLength = 24;
|
|
|
|
|
|
|
|
|
|
|
|
// Group settings section.
|
|
|
|
// Group settings section.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__block BOOL isUserMember;
|
|
|
|
|
|
|
|
NSString *userPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey;
|
|
|
|
|
|
|
|
[LKStorage readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
|
|
|
|
|
|
|
isUserMember = [(TSGroupThread *)self.thread isUserMemberInGroup:userPublicKey transaction:transaction];
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
if (self.isGroupThread && self.isPrivateGroupChat) {
|
|
|
|
if (self.isGroupThread && self.isPrivateGroupChat && isUserMember) {
|
|
|
|
if (((TSGroupThread *)self.thread).usesSharedSenderKeys) {
|
|
|
|
if (((TSGroupThread *)self.thread).usesSharedSenderKeys) {
|
|
|
|
[mainSection addItem:[OWSTableItem
|
|
|
|
[mainSection addItem:[OWSTableItem
|
|
|
|
itemWithCustomCellBlock:^{
|
|
|
|
itemWithCustomCellBlock:^{
|
|
|
@ -682,25 +687,22 @@ const CGFloat kIconViewLength = 24;
|
|
|
|
// [weakSelf showGroupMembersView];
|
|
|
|
// [weakSelf showGroupMembersView];
|
|
|
|
// }]
|
|
|
|
// }]
|
|
|
|
// ];
|
|
|
|
// ];
|
|
|
|
NSString *userPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey;
|
|
|
|
[mainSection addItem:[OWSTableItem
|
|
|
|
if ([((TSGroupThread *)self.thread).groupModel.groupMemberIds containsObject:userPublicKey]) {
|
|
|
|
itemWithCustomCellBlock:^{
|
|
|
|
[mainSection addItem:[OWSTableItem
|
|
|
|
UITableViewCell *cell =
|
|
|
|
itemWithCustomCellBlock:^{
|
|
|
|
[weakSelf disclosureCellWithName:NSLocalizedString(@"LEAVE_GROUP_ACTION",
|
|
|
|
UITableViewCell *cell =
|
|
|
|
@"table cell label in conversation settings")
|
|
|
|
[weakSelf disclosureCellWithName:NSLocalizedString(@"LEAVE_GROUP_ACTION",
|
|
|
|
iconName:@"table_ic_group_leave"
|
|
|
|
@"table cell label in conversation settings")
|
|
|
|
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(
|
|
|
|
iconName:@"table_ic_group_leave"
|
|
|
|
OWSConversationSettingsViewController, @"leave_group")];
|
|
|
|
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(
|
|
|
|
cell.userInteractionEnabled = !weakSelf.hasLeftGroup;
|
|
|
|
OWSConversationSettingsViewController, @"leave_group")];
|
|
|
|
|
|
|
|
cell.userInteractionEnabled = !weakSelf.hasLeftGroup;
|
|
|
|
return cell;
|
|
|
|
|
|
|
|
}
|
|
|
|
return cell;
|
|
|
|
actionBlock:^{
|
|
|
|
}
|
|
|
|
[weakSelf didTapLeaveGroup];
|
|
|
|
actionBlock:^{
|
|
|
|
}]
|
|
|
|
[weakSelf didTapLeaveGroup];
|
|
|
|
];
|
|
|
|
}]
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|