Display fallback when replied event content is partially missing

This commit is contained in:
aringenbach
2022-07-04 15:12:22 +02:00
parent e093fba0d4
commit 6cb0935eca
2 changed files with 9 additions and 1 deletions
@@ -1854,6 +1854,13 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
MXJSONModelSetString(repliedEventContent, repliedEvent.content[kMXMessageBodyKey]);
}
}
// No message content in a non-redacted event. Formatter should use fallback.
if (!repliedEventContent)
{
MXLogWarning(@"[MXKEventFormatter] Unable to retrieve content from replied event %@", repliedEvent.description)
return nil;
}
}
if (event.content[kMXMessageContentKeyNewContent])
@@ -1886,7 +1893,7 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
}
else
{
MXLogDebug(@"[MXKEventFormatter] Unable to build reply event %@", event.description)
MXLogWarning(@"[MXKEventFormatter] Unable to build reply event %@", event.description)
}
return html;