|
|
|
@ -13,7 +13,7 @@
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
NSString *const TSGroupThreadAvatarChangedNotification = @"TSGroupThreadAvatarChangedNotification";
|
|
|
|
|
NSString *const TSGroupThread_NotificaitonKey_UniqueId = @"TSGroupThread_NotificaitonKey_UniqueId";
|
|
|
|
|
NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_NotificationKey_UniqueId";
|
|
|
|
|
|
|
|
|
|
@implementation TSGroupThread
|
|
|
|
|
|
|
|
|
@ -197,12 +197,7 @@ NSString *const TSGroupThread_NotificaitonKey_UniqueId = @"TSGroupThread_Notific
|
|
|
|
|
|
|
|
|
|
[transaction addCompletionQueue:nil
|
|
|
|
|
completionBlock:^{
|
|
|
|
|
NSDictionary *userInfo = @{ TSGroupThread_NotificaitonKey_UniqueId : self.uniqueId };
|
|
|
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter]
|
|
|
|
|
postNotificationName:TSGroupThreadAvatarChangedNotification
|
|
|
|
|
object:self.uniqueId
|
|
|
|
|
userInfo:userInfo];
|
|
|
|
|
[self fireAvatarChangedNotification];
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
// Avatars are stored directly in the database, so there's no need
|
|
|
|
@ -210,6 +205,17 @@ NSString *const TSGroupThread_NotificaitonKey_UniqueId = @"TSGroupThread_Notific
|
|
|
|
|
[attachmentStream removeWithTransaction:transaction];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)fireAvatarChangedNotification
|
|
|
|
|
{
|
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
|
|
|
|
|
|
NSDictionary *userInfo = @{ TSGroupThread_NotificationKey_UniqueId : self.uniqueId };
|
|
|
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:TSGroupThreadAvatarChangedNotification
|
|
|
|
|
object:self.uniqueId
|
|
|
|
|
userInfo:userInfo];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
|