mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Add UI for editing per-thread notification sounds.
This commit is contained in:
parent
dc8b8ca0bd
commit
396fe82707
|
@ -6,6 +6,7 @@
|
|||
#import "BlockListUIUtils.h"
|
||||
#import "ContactsViewHelper.h"
|
||||
#import "FingerprintViewController.h"
|
||||
#import "NotificationSoundsViewController.h"
|
||||
#import "OWSAddToContactViewController.h"
|
||||
#import "OWSBlockingManager.h"
|
||||
#import "PhoneNumber.h"
|
||||
|
@ -438,6 +439,24 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
[contents addSection:mainSection];
|
||||
|
||||
// Notifications section.
|
||||
|
||||
OWSTableSection *notificationsSection = [OWSTableSection new];
|
||||
notificationsSection.headerTitle = NSLocalizedString(@"CONVERSATION_SETTINGS_NOTIFICATIONS_SECTION",
|
||||
@"Label for notifications section of conversation settings view.");
|
||||
[notificationsSection
|
||||
addItem:[OWSTableItem disclosureItemWithText:
|
||||
NSLocalizedString(@"NOTIFICATIONS_ITEM_SOUND",
|
||||
@"Label for settings view that allows user to change the notification sound.")
|
||||
actionBlock:^{
|
||||
NotificationSoundsViewController *vc =
|
||||
[NotificationSoundsViewController new];
|
||||
vc.thread = weakSelf.thread;
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
}]];
|
||||
|
||||
[contents addSection:notificationsSection];
|
||||
|
||||
// Group settings section.
|
||||
|
||||
if (self.isGroupThread) {
|
||||
|
|
|
@ -439,6 +439,9 @@
|
|||
/* Label for 'new contact' button in conversation settings view. */
|
||||
"CONVERSATION_SETTINGS_NEW_CONTACT" = "Create New Contact";
|
||||
|
||||
/* Label for notifications section of conversation settings view. */
|
||||
"CONVERSATION_SETTINGS_NOTIFICATIONS_SECTION" = "Notifications";
|
||||
|
||||
/* Label for button to unmute a thread. */
|
||||
"CONVERSATION_SETTINGS_UNMUTE_ACTION" = "Unmute";
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ FOUNDATION_EXPORT const unsigned char SignalMessagingVersionString[];
|
|||
#import <SignalMessaging/DebugLogger.h>
|
||||
#import <SignalMessaging/Environment.h>
|
||||
#import <SignalMessaging/NSString+OWS.h>
|
||||
#import <SignalMessaging/NotificationSounds.h>
|
||||
#import <SignalMessaging/OWSAudioAttachmentPlayer.h>
|
||||
#import <SignalMessaging/OWSContactAvatarBuilder.h>
|
||||
#import <SignalMessaging/OWSContactOffersInteraction.h>
|
||||
|
|
|
@ -193,6 +193,7 @@ NSString *const kNotificationSoundsStorageGlobalNotificationKey = @"kNotificatio
|
|||
NSNumber *_Nullable value =
|
||||
[notificationSounds.dbConnection objectForKey:kNotificationSoundsStorageGlobalNotificationKey
|
||||
inCollection:kNotificationSoundsStorageNotificationCollection];
|
||||
// Default to the global default.
|
||||
return (value ? (NotificationSound)value.intValue : [self defaultNotificationSound]);
|
||||
}
|
||||
|
||||
|
@ -208,8 +209,9 @@ NSString *const kNotificationSoundsStorageGlobalNotificationKey = @"kNotificatio
|
|||
{
|
||||
NotificationSounds *notificationSounds = NotificationSounds.sharedManager;
|
||||
NSNumber *_Nullable value =
|
||||
[notificationSounds.dbConnection objectForKey:kNotificationSoundsStorageGlobalNotificationKey
|
||||
[notificationSounds.dbConnection objectForKey:thread.uniqueId
|
||||
inCollection:kNotificationSoundsStorageNotificationCollection];
|
||||
// Default to the "global" notification sound, which in turn will default to the global default.
|
||||
return (value ? (NotificationSound)value.intValue : [self globalNotificationSound]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue