|
|
@ -215,24 +215,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
if (!self.isGroupThread && self.thread.hasSafetyNumbers) {
|
|
|
|
if (!self.isGroupThread && self.thread.hasSafetyNumbers) {
|
|
|
|
[firstSection
|
|
|
|
[firstSection
|
|
|
|
addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
UITableViewCell *cell = [UITableViewCell new];
|
|
|
|
return [weakSelf disclosureCellWithName:NSLocalizedString(@"VERIFY_PRIVACY",
|
|
|
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
|
|
@"table cell label in conversation settings")
|
|
|
|
|
|
|
|
iconName:@"table_ic_lock_outline"];
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:@"table_ic_lock_outline"];
|
|
|
|
|
|
|
|
[cell.contentView addSubview:iconView];
|
|
|
|
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *rowLabel = [UILabel new];
|
|
|
|
|
|
|
|
rowLabel.text = NSLocalizedString(@"VERIFY_PRIVACY", @"table cell label in conversation settings");
|
|
|
|
|
|
|
|
rowLabel.textColor = [UIColor blackColor];
|
|
|
|
|
|
|
|
rowLabel.font = [UIFont ows_regularFontWithSize:17.f];
|
|
|
|
|
|
|
|
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
|
|
|
|
[cell.contentView addSubview:rowLabel];
|
|
|
|
|
|
|
|
[rowLabel autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[rowLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:iconView withOffset:12.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
|
|
|
|
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
|
|
|
@ -322,7 +307,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[topView autoPinEdgeToSuperviewEdge:ALEdgeTop];
|
|
|
|
[topView autoPinEdgeToSuperviewEdge:ALEdgeTop];
|
|
|
|
[topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight];
|
|
|
|
[topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight];
|
|
|
|
|
|
|
|
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:@"table_ic_hourglass_empty"];
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:@"table_ic_hourglass"];
|
|
|
|
[topView addSubview:iconView];
|
|
|
|
[topView addSubview:iconView];
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
@ -363,48 +348,17 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
if (self.isGroupThread) {
|
|
|
|
if (self.isGroupThread) {
|
|
|
|
NSArray *groupItems = @[
|
|
|
|
NSArray *groupItems = @[
|
|
|
|
[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
UITableViewCell *cell = [UITableViewCell new];
|
|
|
|
return [weakSelf disclosureCellWithName:NSLocalizedString(@"EDIT_GROUP_ACTION",
|
|
|
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
|
|
@"table cell label in conversation settings")
|
|
|
|
|
|
|
|
iconName:@"table_ic_group_edit"];
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:@"table_ic_group_edit"];
|
|
|
|
|
|
|
|
[cell.contentView addSubview:iconView];
|
|
|
|
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *rowLabel = [UILabel new];
|
|
|
|
|
|
|
|
rowLabel.text = NSLocalizedString(@"EDIT_GROUP_ACTION", @"table cell label in conversation settings");
|
|
|
|
|
|
|
|
rowLabel.textColor = [UIColor blackColor];
|
|
|
|
|
|
|
|
rowLabel.font = [UIFont ows_regularFontWithSize:17.f];
|
|
|
|
|
|
|
|
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
|
|
|
|
[cell.contentView addSubview:rowLabel];
|
|
|
|
|
|
|
|
[rowLabel autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[rowLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:iconView withOffset:12.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf showUpdateGroupView:UpdateGroupMode_Default];
|
|
|
|
[weakSelf showUpdateGroupView:UpdateGroupMode_Default];
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
UITableViewCell *cell = [UITableViewCell new];
|
|
|
|
return [weakSelf disclosureCellWithName:NSLocalizedString(@"LIST_GROUP_MEMBERS_ACTION",
|
|
|
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
|
|
@"table cell label in conversation settings")
|
|
|
|
|
|
|
|
iconName:@"table_ic_group_members"];
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:@"table_ic_group_members"];
|
|
|
|
|
|
|
|
[cell.contentView addSubview:iconView];
|
|
|
|
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *rowLabel = [UILabel new];
|
|
|
|
|
|
|
|
rowLabel.text
|
|
|
|
|
|
|
|
= NSLocalizedString(@"LIST_GROUP_MEMBERS_ACTION", @"table cell label in conversation settings");
|
|
|
|
|
|
|
|
rowLabel.textColor = [UIColor blackColor];
|
|
|
|
|
|
|
|
rowLabel.font = [UIFont ows_regularFontWithSize:17.f];
|
|
|
|
|
|
|
|
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
|
|
|
|
[cell.contentView addSubview:rowLabel];
|
|
|
|
|
|
|
|
[rowLabel autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[rowLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:iconView withOffset:12.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
|
|
|
|
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
|
|
|
@ -417,24 +371,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[strongSelf.navigationController pushViewController:showGroupMembersViewController animated:YES];
|
|
|
|
[strongSelf.navigationController pushViewController:showGroupMembersViewController animated:YES];
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
UITableViewCell *cell = [UITableViewCell new];
|
|
|
|
return [weakSelf disclosureCellWithName:NSLocalizedString(@"LEAVE_GROUP_ACTION",
|
|
|
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
|
|
@"table cell label in conversation settings")
|
|
|
|
|
|
|
|
iconName:@"table_ic_group_leave"];
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:@"table_ic_group_leave"];
|
|
|
|
|
|
|
|
[cell.contentView addSubview:iconView];
|
|
|
|
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *rowLabel = [UILabel new];
|
|
|
|
|
|
|
|
rowLabel.text = NSLocalizedString(@"LEAVE_GROUP_ACTION", @"table cell label in conversation settings");
|
|
|
|
|
|
|
|
rowLabel.textColor = [UIColor blackColor];
|
|
|
|
|
|
|
|
rowLabel.font = [UIFont ows_regularFontWithSize:17.f];
|
|
|
|
|
|
|
|
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
|
|
|
|
[cell.contentView addSubview:rowLabel];
|
|
|
|
|
|
|
|
[rowLabel autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[rowLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:iconView withOffset:12.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf didTapLeaveGroup];
|
|
|
|
[weakSelf didTapLeaveGroup];
|
|
|
@ -518,24 +457,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
BOOL isBlocked = [[_blockingManager blockedPhoneNumbers] containsObject:self.thread.contactIdentifier];
|
|
|
|
BOOL isBlocked = [[_blockingManager blockedPhoneNumbers] containsObject:self.thread.contactIdentifier];
|
|
|
|
|
|
|
|
|
|
|
|
OWSTableItem *item = [OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
OWSTableItem *item = [OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
UITableViewCell *cell = [UITableViewCell new];
|
|
|
|
UITableViewCell *cell =
|
|
|
|
|
|
|
|
[weakSelf disclosureCellWithName:NSLocalizedString(@"CONVERSATION_SETTINGS_BLOCK_THIS_USER",
|
|
|
|
|
|
|
|
@"table cell label in conversation settings")
|
|
|
|
|
|
|
|
iconName:@"table_ic_block"];
|
|
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
|
|
|
|
|
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:@"table_ic_block"];
|
|
|
|
|
|
|
|
[cell.contentView addSubview:iconView];
|
|
|
|
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *rowLabel = [UILabel new];
|
|
|
|
|
|
|
|
rowLabel.text = NSLocalizedString(
|
|
|
|
|
|
|
|
@"CONVERSATION_SETTINGS_BLOCK_THIS_USER", @"table cell label in conversation settings");
|
|
|
|
|
|
|
|
rowLabel.textColor = [UIColor blackColor];
|
|
|
|
|
|
|
|
rowLabel.font = [UIFont ows_regularFontWithSize:17.f];
|
|
|
|
|
|
|
|
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
|
|
|
|
[cell.contentView addSubview:rowLabel];
|
|
|
|
|
|
|
|
[rowLabel autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[rowLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:iconView withOffset:12.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UISwitch *blockUserSwitch = [UISwitch new];
|
|
|
|
UISwitch *blockUserSwitch = [UISwitch new];
|
|
|
|
blockUserSwitch.on = isBlocked;
|
|
|
|
blockUserSwitch.on = isBlocked;
|
|
|
|
[blockUserSwitch addTarget:self
|
|
|
|
[blockUserSwitch addTarget:self
|
|
|
@ -558,6 +485,31 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[self.tableView reloadData];
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (UITableViewCell *)disclosureCellWithName:(NSString *)name iconName:(NSString *)iconName
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
OWSAssert(name.length > 0);
|
|
|
|
|
|
|
|
OWSAssert(iconName.length > 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UITableViewCell *cell = [UITableViewCell new];
|
|
|
|
|
|
|
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UIImageView *iconView = [self viewForIconWithName:iconName];
|
|
|
|
|
|
|
|
[cell.contentView addSubview:iconView];
|
|
|
|
|
|
|
|
[iconView autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[iconView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:16.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *rowLabel = [UILabel new];
|
|
|
|
|
|
|
|
rowLabel.text = name;
|
|
|
|
|
|
|
|
rowLabel.textColor = [UIColor blackColor];
|
|
|
|
|
|
|
|
rowLabel.font = [UIFont ows_regularFontWithSize:17.f];
|
|
|
|
|
|
|
|
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
|
|
|
|
[cell.contentView addSubview:rowLabel];
|
|
|
|
|
|
|
|
[rowLabel autoVCenterInSuperview];
|
|
|
|
|
|
|
|
[rowLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:iconView withOffset:12.f];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (UIView *)firstSectionHeader
|
|
|
|
- (UIView *)firstSectionHeader
|
|
|
|
{
|
|
|
|
{
|
|
|
|
UIView *firstSectionHeader = [UIView new];
|
|
|
|
UIView *firstSectionHeader = [UIView new];
|
|
|
|