From 0b29def940c7e377c60ca9e6580350ec6f0b2920 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Tue, 14 Apr 2020 10:07:53 +1000 Subject: [PATCH] Minor refactoring --- .../ConversationView/ConversationViewController.m | 4 ++-- SignalServiceKit/src/Contacts/Threads/TSGroupThread.m | 6 ++---- SignalServiceKit/src/Loki/Utilities/Notification+Loki.swift | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index f4df8b1f1..bee6ec9d0 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -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(); diff --git a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m index 4d0ccde47..4d65917f9 100644 --- a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m +++ b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m @@ -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]; }]; } diff --git a/SignalServiceKit/src/Loki/Utilities/Notification+Loki.swift b/SignalServiceKit/src/Loki/Utilities/Notification+Loki.swift index 0055ebb17..33859f32a 100644 --- a/SignalServiceKit/src/Loki/Utilities/Notification+Loki.swift +++ b/SignalServiceKit/src/Loki/Utilities/Notification+Loki.swift @@ -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")