mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-09 01:17:41 +02:00
Merge pull request #5768 from vector-im/andy/redacted_messages
Do not render redacted messages
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user