Minor refactoring

This commit is contained in:
nielsandriesse 2020-04-14 10:07:53 +10:00
parent 7243dcb48d
commit 0b29def940
3 changed files with 5 additions and 7 deletions

View File

@ -425,7 +425,7 @@ typedef enum : NSUInteger {
name:NSNotification.threadSessionRestoreDevicesChanged
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleGroupThreadUpdated:)
selector:@selector(handleGroupThreadUpdatedNotification:)
name:NSNotification.groupThreadUpdated
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
@ -511,7 +511,7 @@ typedef enum : NSUInteger {
[self ensureBannerState];
}
- (void)handleGroupThreadUpdated:(NSNotification *)notification
- (void)handleGroupThreadUpdatedNotification:(NSNotification *)notification
{
OWSAssertIsOnMainThread();

View File

@ -237,8 +237,7 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific
self.groupModel = newGroupModel;
[self saveWithTransaction:transaction];
[transaction addCompletionQueue:dispatch_get_main_queue()
completionBlock:^{
[transaction addCompletionQueue:dispatch_get_main_queue() completionBlock:^{
[NSNotificationCenter.defaultCenter postNotificationName:NSNotification.groupThreadUpdated object:self.uniqueId];
}];
}
@ -261,8 +260,7 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific
self.groupModel.groupMemberIds = newGroupMemberIDs.allObjects;
[self saveWithTransaction:transaction];
[transaction addCompletionQueue:dispatch_get_main_queue()
completionBlock:^{
[transaction addCompletionQueue:dispatch_get_main_queue() completionBlock:^{
[NSNotificationCenter.defaultCenter postNotificationName:NSNotification.groupThreadUpdated object:self.uniqueId];
}];
}

View File

@ -4,7 +4,7 @@ public extension Notification.Name {
// State changes
public static let contactOnlineStatusChanged = Notification.Name("contactOnlineStatusChanged")
public static let threadFriendRequestStatusChanged = Notification.Name("threadFriendRequestStatusChanged")
public static let groupThreadUpdated = Notification.Name("groupThreadLeft")
public static let groupThreadUpdated = Notification.Name("groupThreadUpdated")
public static let messageFriendRequestStatusChanged = Notification.Name("messageFriendRequestStatusChanged")
public static let threadDeleted = Notification.Name("threadDeleted")
public static let threadSessionRestoreDevicesChanged = Notification.Name("threadSessionRestoreDevicesChanged")