diff --git a/Riot/Utils/EventFormatter.m b/Riot/Utils/EventFormatter.m index f4d0a2dbd..e1dbffbb6 100644 --- a/Riot/Utils/EventFormatter.m +++ b/Riot/Utils/EventFormatter.m @@ -69,11 +69,7 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm"; // If we cannot create attributed string, but the message is nevertheless meant for display (e.g. not an edit event), show generic error // instead of a missing message on a timeline. - if ( - !string - && [self.eventTypesFilterForMessages containsObject:event.type] - && !event.isEditEvent - ) + if (!string && [self shouldDisplayEvent:event]) { MXLogError(@"[EventFormatter]: Cannot format string for displayable event: %@, type: %@, msgtype: %@, has room state: %d, members: %lu, error: %lu", event.eventId, @@ -89,6 +85,12 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm"; return string; } +- (BOOL)shouldDisplayEvent:(MXEvent *)event { + return [self.eventTypesFilterForMessages containsObject:event.type] + && !event.isEditEvent + && !event.isRedactedEvent; +} + // The attributed string can fail to be created for a number of reasons, and the size of the function (as well as super's implementation) makes // it impossible to catch all the `return nil` and failure states. // To make catching of missing strings reliable (and not place that burden on callers), we use private `unsafeAttributedStringFromEvent` method