diff --git a/MatrixKit/Categories/MXEvent+MatrixKit.h b/MatrixKit/Categories/MXEvent+MatrixKit.h index 24aeeb5f2..8f82db70e 100644 --- a/MatrixKit/Categories/MXEvent+MatrixKit.h +++ b/MatrixKit/Categories/MXEvent+MatrixKit.h @@ -74,16 +74,6 @@ typedef enum : NSUInteger */ - (void)setMxkState:(MXKEventState)mxkState; -/** - Indicates if the event has been redacted - */ -- (BOOL)isRedactedEvent; - -/** - Return YES if the event is an emote event - */ -- (BOOL)isEmote; - /** Return YES if the event contains a media: image, audio, video or file. */ diff --git a/MatrixKit/Categories/MXEvent+MatrixKit.m b/MatrixKit/Categories/MXEvent+MatrixKit.m index fd7bda87f..967ff0a80 100644 --- a/MatrixKit/Categories/MXEvent+MatrixKit.m +++ b/MatrixKit/Categories/MXEvent+MatrixKit.m @@ -34,24 +34,6 @@ - (void)setMxkState:(MXKEventState)state objc_setAssociatedObject(self, @selector(state), [NSNumber numberWithUnsignedInteger:state], OBJC_ASSOCIATION_RETAIN_NONATOMIC); } -- (BOOL)isRedactedEvent -{ - return (self.redactedBecause != nil); -} - -- (BOOL)isEmote -{ - if (self.eventType == MXEventTypeRoomMessage) - { - NSString *msgtype = self.content[@"msgtype"]; - if ([msgtype isEqualToString:kMXMessageTypeEmote]) - { - return YES; - } - } - return NO; -} - - (BOOL)isMediaAttachment { if (self.eventType == MXEventTypeRoomMessage) diff --git a/MatrixKit/Controllers/MXKRoomMemberDetailsViewController.m b/MatrixKit/Controllers/MXKRoomMemberDetailsViewController.m index 1ac4fe263..7476dc863 100644 --- a/MatrixKit/Controllers/MXKRoomMemberDetailsViewController.m +++ b/MatrixKit/Controllers/MXKRoomMemberDetailsViewController.m @@ -36,8 +36,8 @@ @interface MXKRoomMemberDetailsViewController () // Observe left rooms id leaveRoomNotificationObserver; - // Observe kMXRoomDidFlushMessagesNotification to take into account the updated room members when the room history is flushed. - id roomDidFlushMessagesNotificationObserver; + // Observe kMXRoomDidFlushDataNotification to take into account the updated room members when the room history is flushed. + id roomDidFlushDataNotificationObserver; } @end @@ -483,7 +483,7 @@ - (void)initObservers }]; // Observe room history flush (sync with limited timeline, or state event redaction) - roomDidFlushMessagesNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXRoomDidFlushMessagesNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { + roomDidFlushDataNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXRoomDidFlushDataNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { MXRoom *room = notif.object; if (self.mainSession == room.mxSession && [mxRoom.state.roomId isEqualToString:room.state.roomId]) @@ -506,10 +506,10 @@ - (void)removeObservers [[NSNotificationCenter defaultCenter] removeObserver:leaveRoomNotificationObserver]; leaveRoomNotificationObserver = nil; } - if (roomDidFlushMessagesNotificationObserver) + if (roomDidFlushDataNotificationObserver) { - [[NSNotificationCenter defaultCenter] removeObserver:roomDidFlushMessagesNotificationObserver]; - roomDidFlushMessagesNotificationObserver = nil; + [[NSNotificationCenter defaultCenter] removeObserver:roomDidFlushDataNotificationObserver]; + roomDidFlushDataNotificationObserver = nil; } [[NSNotificationCenter defaultCenter] removeObserver:self]; diff --git a/MatrixKit/Controllers/MXKRoomSettingsViewController.m b/MatrixKit/Controllers/MXKRoomSettingsViewController.m index a83aa4920..9e3e848c4 100644 --- a/MatrixKit/Controllers/MXKRoomSettingsViewController.m +++ b/MatrixKit/Controllers/MXKRoomSettingsViewController.m @@ -26,8 +26,8 @@ @interface MXKRoomSettingsViewController() // Observe kMXSessionWillLeaveRoomNotification to be notified if the user leaves the current room. id leaveRoomNotificationObserver; - // Observe kMXRoomDidFlushMessagesNotification to take into account the updated room state when the room history is flushed. - id roomDidFlushMessagesNotificationObserver; + // Observe kMXRoomDidFlushDataNotification to take into account the updated room state when the room history is flushed. + id roomDidFlushDataNotificationObserver; } @end @@ -72,10 +72,10 @@ - (void)destroy leaveRoomNotificationObserver = nil; } - if (roomDidFlushMessagesNotificationObserver) + if (roomDidFlushDataNotificationObserver) { - [[NSNotificationCenter defaultCenter] removeObserver:roomDidFlushMessagesNotificationObserver]; - roomDidFlushMessagesNotificationObserver = nil; + [[NSNotificationCenter defaultCenter] removeObserver:roomDidFlushDataNotificationObserver]; + roomDidFlushDataNotificationObserver = nil; } mxRoom = nil; @@ -153,7 +153,7 @@ - (void)initWithSession:(MXSession*)mxSession andRoomId:(NSString*)roomId }]; // Observe room history flush (sync with limited timeline, or state event redaction) - roomDidFlushMessagesNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXRoomDidFlushMessagesNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { + roomDidFlushDataNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXRoomDidFlushDataNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { MXRoom *room = notif.object; if (self.mainSession == room.mxSession && [self.roomId isEqualToString:room.state.roomId]) diff --git a/MatrixKit/Models/Room/MXKRoomDataSource.m b/MatrixKit/Models/Room/MXKRoomDataSource.m index 4c7822893..43cd1b9d4 100644 --- a/MatrixKit/Models/Room/MXKRoomDataSource.m +++ b/MatrixKit/Models/Room/MXKRoomDataSource.m @@ -108,9 +108,9 @@ Current pagination request (if any) id NSCurrentLocaleDidChangeNotificationObserver; /** - Observe kMXRoomDidFlushMessagesNotification to trigger cell change when existing room history has been flushed during server sync. + Observe kMXRoomDidFlushDataNotification to trigger cell change when existing room history has been flushed during server sync. */ - id roomDidFlushMessagesNotificationObserver; + id roomDidFlushDataNotificationObserver; /** Observe kMXRoomDidUpdateUnreadNotification to refresh unread counters. @@ -322,10 +322,10 @@ - (void)limitMemoryUsage:(NSInteger)maxBubbleNb - (void)reset { - if (roomDidFlushMessagesNotificationObserver) + if (roomDidFlushDataNotificationObserver) { - [[NSNotificationCenter defaultCenter] removeObserver:roomDidFlushMessagesNotificationObserver]; - roomDidFlushMessagesNotificationObserver = nil; + [[NSNotificationCenter defaultCenter] removeObserver:roomDidFlushDataNotificationObserver]; + roomDidFlushDataNotificationObserver = nil; } if (roomDidUpdateUnreadNotificationObserver) @@ -484,7 +484,7 @@ - (void)didMXSessionStateChange [_timeline resetPagination]; // Observe room history flush (sync with limited timeline, or state event redaction) - roomDidFlushMessagesNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXRoomDidFlushMessagesNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { + roomDidFlushDataNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXRoomDidFlushDataNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { MXRoom *room = notif.object; if (self.mxSession == room.mxSession && [self.roomId isEqualToString:room.state.roomId]) diff --git a/MatrixKit/Views/MXKEventDetailsView.m b/MatrixKit/Views/MXKEventDetailsView.m index 08753b669..bf0362d35 100644 --- a/MatrixKit/Views/MXKEventDetailsView.m +++ b/MatrixKit/Views/MXKEventDetailsView.m @@ -16,7 +16,6 @@ #import "MXKEventDetailsView.h" -#import "MXEvent+MatrixKit.h" #import "NSBundle+MatrixKit.h" #import "MXKConstants.h"