|
|
@ -284,12 +284,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - Table Contents
|
|
|
|
#pragma mark - Table Contents
|
|
|
|
|
|
|
|
|
|
|
|
- (CGFloat)actionCellHeight
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return ScaleFromIPhone5To7Plus(round((kOWSTable_DefaultCellHeight + [ContactTableViewCell rowHeight]) * 0.5f),
|
|
|
|
|
|
|
|
[ContactTableViewCell rowHeight]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)updateTableContents
|
|
|
|
- (void)updateTableContents
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OWSTableContents *contents = [OWSTableContents new];
|
|
|
|
OWSTableContents *contents = [OWSTableContents new];
|
|
|
@ -307,7 +301,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[staticSection
|
|
|
|
[staticSection
|
|
|
|
addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"NEW_CONVERSATION_FIND_BY_PHONE_NUMBER",
|
|
|
|
addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"NEW_CONVERSATION_FIND_BY_PHONE_NUMBER",
|
|
|
|
@"A label the cell that lets you add a new member to a group.")
|
|
|
|
@"A label the cell that lets you add a new member to a group.")
|
|
|
|
customRowHeight:self.actionCellHeight
|
|
|
|
customRowHeight:UITableViewAutomaticDimension
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
NewNonContactConversationViewController *viewController =
|
|
|
|
NewNonContactConversationViewController *viewController =
|
|
|
|
[NewNonContactConversationViewController new];
|
|
|
|
[NewNonContactConversationViewController new];
|
|
|
@ -322,7 +316,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
addItem:[OWSTableItem
|
|
|
|
addItem:[OWSTableItem
|
|
|
|
disclosureItemWithText:NSLocalizedString(@"INVITE_FRIENDS_CONTACT_TABLE_BUTTON",
|
|
|
|
disclosureItemWithText:NSLocalizedString(@"INVITE_FRIENDS_CONTACT_TABLE_BUTTON",
|
|
|
|
@"Label for the cell that presents the 'invite contacts' workflow.")
|
|
|
|
@"Label for the cell that presents the 'invite contacts' workflow.")
|
|
|
|
customRowHeight:self.actionCellHeight
|
|
|
|
customRowHeight:UITableViewAutomaticDimension
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf presentInviteFlow];
|
|
|
|
[weakSelf presentInviteFlow];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
@ -382,7 +376,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
addItem:[OWSTableItem softCenterLabelItemWithText:
|
|
|
|
addItem:[OWSTableItem softCenterLabelItemWithText:
|
|
|
|
NSLocalizedString(@"SETTINGS_BLOCK_LIST_NO_CONTACTS",
|
|
|
|
NSLocalizedString(@"SETTINGS_BLOCK_LIST_NO_CONTACTS",
|
|
|
|
@"A label that indicates the user has no Signal contacts.")
|
|
|
|
@"A label that indicates the user has no Signal contacts.")
|
|
|
|
customRowHeight:self.actionCellHeight]];
|
|
|
|
customRowHeight:UITableViewAutomaticDimension]];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
UITableViewCell *loadingCell = [UITableViewCell new];
|
|
|
|
UITableViewCell *loadingCell = [UITableViewCell new];
|
|
|
|
OWSAssert(loadingCell.contentView);
|
|
|
|
OWSAssert(loadingCell.contentView);
|
|
|
@ -481,7 +475,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
OWSAssert(phoneNumber.length > 0);
|
|
|
|
OWSAssert(phoneNumber.length > 0);
|
|
|
|
|
|
|
|
|
|
|
|
if ([self.nonContactAccountSet containsObject:phoneNumber]) {
|
|
|
|
if ([self.nonContactAccountSet containsObject:phoneNumber]) {
|
|
|
|
[phoneNumbersSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
[phoneNumbersSection
|
|
|
|
|
|
|
|
addItem:[OWSTableItem
|
|
|
|
|
|
|
|
itemWithCustomCellBlock:^{
|
|
|
|
ContactTableViewCell *cell = [ContactTableViewCell new];
|
|
|
|
ContactTableViewCell *cell = [ContactTableViewCell new];
|
|
|
|
BOOL isBlocked = [helper isRecipientIdBlocked:phoneNumber];
|
|
|
|
BOOL isBlocked = [helper isRecipientIdBlocked:phoneNumber];
|
|
|
|
if (isBlocked) {
|
|
|
|
if (isBlocked) {
|
|
|
@ -491,14 +487,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
|
|
SignalAccount *signalAccount = [helper signalAccountForRecipientId:phoneNumber];
|
|
|
|
SignalAccount *signalAccount = [helper signalAccountForRecipientId:phoneNumber];
|
|
|
|
if (signalAccount) {
|
|
|
|
if (signalAccount) {
|
|
|
|
[cell configureWithSignalAccount:signalAccount contactsManager:helper.contactsManager];
|
|
|
|
[cell configureWithSignalAccount:signalAccount
|
|
|
|
|
|
|
|
contactsManager:helper.contactsManager];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
[cell configureWithRecipientId:phoneNumber contactsManager:helper.contactsManager];
|
|
|
|
[cell configureWithRecipientId:phoneNumber contactsManager:helper.contactsManager];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customRowHeight:[ContactTableViewCell rowHeight]
|
|
|
|
customRowHeight:UITableViewAutomaticDimension
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf newConversationWithRecipientId:phoneNumber];
|
|
|
|
[weakSelf newConversationWithRecipientId:phoneNumber];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
@ -508,7 +505,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@"placeholder for the recipient's phone number."),
|
|
|
|
@"placeholder for the recipient's phone number."),
|
|
|
|
phoneNumber];
|
|
|
|
phoneNumber];
|
|
|
|
[phoneNumbersSection addItem:[OWSTableItem disclosureItemWithText:text
|
|
|
|
[phoneNumbersSection addItem:[OWSTableItem disclosureItemWithText:text
|
|
|
|
customRowHeight:self.actionCellHeight
|
|
|
|
customRowHeight:UITableViewAutomaticDimension
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf sendTextToPhoneNumber:phoneNumber];
|
|
|
|
[weakSelf sendTextToPhoneNumber:phoneNumber];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
@ -533,19 +530,21 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
// results.
|
|
|
|
// results.
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[contactsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
[contactsSection
|
|
|
|
|
|
|
|
addItem:[OWSTableItem
|
|
|
|
|
|
|
|
itemWithCustomCellBlock:^{
|
|
|
|
ContactTableViewCell *cell = [ContactTableViewCell new];
|
|
|
|
ContactTableViewCell *cell = [ContactTableViewCell new];
|
|
|
|
BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId];
|
|
|
|
BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId];
|
|
|
|
if (isBlocked) {
|
|
|
|
if (isBlocked) {
|
|
|
|
cell.accessoryMessage
|
|
|
|
cell.accessoryMessage = NSLocalizedString(
|
|
|
|
= NSLocalizedString(@"CONTACT_CELL_IS_BLOCKED", @"An indicator that a contact has been blocked.");
|
|
|
|
@"CONTACT_CELL_IS_BLOCKED", @"An indicator that a contact has been blocked.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[cell configureWithSignalAccount:signalAccount contactsManager:helper.contactsManager];
|
|
|
|
[cell configureWithSignalAccount:signalAccount contactsManager:helper.contactsManager];
|
|
|
|
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customRowHeight:[ContactTableViewCell rowHeight]
|
|
|
|
customRowHeight:UITableViewAutomaticDimension
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf newConversationWithRecipientId:signalAccount.recipientId];
|
|
|
|
[weakSelf newConversationWithRecipientId:signalAccount.recipientId];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
@ -562,12 +561,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
for (TSGroupThread *thread in filteredGroupThreads) {
|
|
|
|
for (TSGroupThread *thread in filteredGroupThreads) {
|
|
|
|
hasSearchResults = YES;
|
|
|
|
hasSearchResults = YES;
|
|
|
|
|
|
|
|
|
|
|
|
[groupSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
[groupSection addItem:[OWSTableItem
|
|
|
|
|
|
|
|
itemWithCustomCellBlock:^{
|
|
|
|
GroupTableViewCell *cell = [GroupTableViewCell new];
|
|
|
|
GroupTableViewCell *cell = [GroupTableViewCell new];
|
|
|
|
[cell configureWithThread:thread contactsManager:helper.contactsManager];
|
|
|
|
[cell configureWithThread:thread contactsManager:helper.contactsManager];
|
|
|
|
return cell;
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customRowHeight:[ContactTableViewCell rowHeight]
|
|
|
|
customRowHeight:UITableViewAutomaticDimension
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf newConversationWithThread:thread];
|
|
|
|
[weakSelf newConversationWithThread:thread];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
@ -597,7 +597,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@"placeholder for the recipient's phone number."),
|
|
|
|
@"placeholder for the recipient's phone number."),
|
|
|
|
displayName];
|
|
|
|
displayName];
|
|
|
|
[inviteeSection addItem:[OWSTableItem disclosureItemWithText:text
|
|
|
|
[inviteeSection addItem:[OWSTableItem disclosureItemWithText:text
|
|
|
|
customRowHeight:self.actionCellHeight
|
|
|
|
customRowHeight:UITableViewAutomaticDimension
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[weakSelf sendTextToPhoneNumber:phoneNumber.toE164];
|
|
|
|
[weakSelf sendTextToPhoneNumber:phoneNumber.toE164];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
@ -614,7 +614,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
addItem:[OWSTableItem softCenterLabelItemWithText:
|
|
|
|
addItem:[OWSTableItem softCenterLabelItemWithText:
|
|
|
|
NSLocalizedString(@"SETTINGS_BLOCK_LIST_NO_SEARCH_RESULTS",
|
|
|
|
NSLocalizedString(@"SETTINGS_BLOCK_LIST_NO_SEARCH_RESULTS",
|
|
|
|
@"A label that indicates the user's search has no matching results.")
|
|
|
|
@"A label that indicates the user's search has no matching results.")
|
|
|
|
customRowHeight:self.actionCellHeight]];
|
|
|
|
customRowHeight:UITableViewAutomaticDimension]];
|
|
|
|
|
|
|
|
|
|
|
|
[sections addObject:noResultsSection];
|
|
|
|
[sections addObject:noResultsSection];
|
|
|
|
}
|
|
|
|
}
|
|
|
|