|
|
|
@ -20,6 +20,7 @@
|
|
|
|
|
#import <SignalMessaging/OWSAvatarBuilder.h>
|
|
|
|
|
#import <SignalMessaging/OWSContactsManager.h>
|
|
|
|
|
#import <SignalMessaging/OWSProfileManager.h>
|
|
|
|
|
#import <SignalMessaging/OWSSounds.h>
|
|
|
|
|
#import <SignalMessaging/OWSUserProfile.h>
|
|
|
|
|
#import <SignalMessaging/UIUtil.h>
|
|
|
|
|
#import <SignalServiceKit/NSDate+OWS.h>
|
|
|
|
@ -572,29 +573,40 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
OWSTableSection *soundsSection = [OWSTableSection new];
|
|
|
|
|
soundsSection.headerTitle = NSLocalizedString(@"SETTINGS_SECTION_SOUNDS",
|
|
|
|
|
@"Label for the sounds section of settings views.");
|
|
|
|
|
[soundsSection
|
|
|
|
|
addItem:[OWSTableItem disclosureItemWithText:
|
|
|
|
|
NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
|
|
|
|
|
@"Label for settings view that allows user to change the notification sound.")
|
|
|
|
|
actionBlock:^{
|
|
|
|
|
OWSSoundSettingsViewController *vc =
|
|
|
|
|
[OWSSoundSettingsViewController new];
|
|
|
|
|
vc.soundType = OWSSoundType_Notification;
|
|
|
|
|
vc.thread = weakSelf.thread;
|
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}]];
|
|
|
|
|
[soundsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
|
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
|
|
|
|
|
reuseIdentifier:@"UITableViewCellStyleValue1"];
|
|
|
|
|
cell.textLabel.text = NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
|
|
|
|
|
@"Label for settings view that allows user to change the notification sound.");
|
|
|
|
|
OWSSound sound = [OWSSounds notificationSoundForThread:self.thread];
|
|
|
|
|
cell.detailTextLabel.text = [OWSSounds displayNameForSound:sound];
|
|
|
|
|
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
|
|
|
|
|
return cell;
|
|
|
|
|
}
|
|
|
|
|
actionBlock:^{
|
|
|
|
|
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
|
|
|
|
|
vc.soundType = OWSSoundType_Notification;
|
|
|
|
|
vc.thread = weakSelf.thread;
|
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}]];
|
|
|
|
|
if (!self.isGroupThread) {
|
|
|
|
|
[soundsSection
|
|
|
|
|
addItem:[OWSTableItem disclosureItemWithText:
|
|
|
|
|
NSLocalizedString(@"SETTINGS_ITEM_RINGTONE_SOUND",
|
|
|
|
|
@"Label for settings view that allows user to change the ringtone sound.")
|
|
|
|
|
actionBlock:^{
|
|
|
|
|
OWSSoundSettingsViewController *vc =
|
|
|
|
|
[OWSSoundSettingsViewController new];
|
|
|
|
|
vc.soundType = OWSSoundType_Ringtone;
|
|
|
|
|
vc.thread = weakSelf.thread;
|
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}]];
|
|
|
|
|
|
|
|
|
|
[soundsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
|
|
|
|
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
|
|
|
|
|
reuseIdentifier:@"UITableViewCellStyleValue1"];
|
|
|
|
|
cell.textLabel.text = NSLocalizedString(@"SETTINGS_ITEM_RINGTONE_SOUND",
|
|
|
|
|
@"Label for settings view that allows user to change the ringtone sound.");
|
|
|
|
|
OWSSound sound = [OWSSounds ringtoneSoundForThread:self.thread];
|
|
|
|
|
cell.detailTextLabel.text = [OWSSounds displayNameForSound:sound];
|
|
|
|
|
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
|
|
|
|
|
return cell;
|
|
|
|
|
}
|
|
|
|
|
actionBlock:^{
|
|
|
|
|
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
|
|
|
|
|
vc.soundType = OWSSoundType_Ringtone;
|
|
|
|
|
vc.thread = weakSelf.thread;
|
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}]];
|
|
|
|
|
}
|
|
|
|
|
[contents addSection:soundsSection];
|
|
|
|
|
|
|
|
|
|