Don't show leave group option if user has already left

pull/257/head
nielsandriesse 5 years ago
parent cd7efff6f8
commit aa14e9b7ad

@ -683,22 +683,25 @@ const CGFloat kIconViewLength = 24;
[weakSelf showGroupMembersView]; [weakSelf showGroupMembersView];
}] }]
]; ];
[mainSection addItem:[OWSTableItem NSString *userPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey;
itemWithCustomCellBlock:^{ if ([((TSGroupThread *)self.thread).groupModel.groupMemberIds containsObject:userPublicKey]) {
UITableViewCell *cell = [mainSection addItem:[OWSTableItem
[weakSelf disclosureCellWithName:NSLocalizedString(@"LEAVE_GROUP_ACTION", itemWithCustomCellBlock:^{
@"table cell label in conversation settings") UITableViewCell *cell =
iconName:@"table_ic_group_leave" [weakSelf disclosureCellWithName:NSLocalizedString(@"LEAVE_GROUP_ACTION",
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME( @"table cell label in conversation settings")
OWSConversationSettingsViewController, @"leave_group")]; iconName:@"table_ic_group_leave"
cell.userInteractionEnabled = !weakSelf.hasLeftGroup; accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(
OWSConversationSettingsViewController, @"leave_group")];
return cell; cell.userInteractionEnabled = !weakSelf.hasLeftGroup;
}
actionBlock:^{ return cell;
[weakSelf didTapLeaveGroup]; }
}] actionBlock:^{
]; [weakSelf didTapLeaveGroup];
}]
];
}
} }

Loading…
Cancel
Save