Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

MXKEventFormatter: Be robust on malformatted m.relates_to data content #482

Merged
merged 1 commit into from
Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Changes in MatrixKit in 0.8.6 (2018-10-)
==========================================

Improvements:
* Upgrade MatrixSDK version (v0.11.6).

Bug fix:
* MXKEventFormatter: Be robust on malformatted m.relates_to data content (vector-im/riot-ios/issues/2080).

Changes in MatrixKit in 0.8.5 (2018-10-05)
==========================================

Expand Down
4 changes: 3 additions & 1 deletion MatrixKit/Utils/EventFormatter/MXKEventFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,9 @@ - (NSAttributedString*)renderHTMLString:(NSString*)htmlString forEvent:(MXEvent*
NSString *html = htmlString;

// Special treatment for "In reply to" message
if (event.content[@"m.relates_to"][@"m.in_reply_to"])
NSDictionary *relatesTo;
MXJSONModelSetDictionary(relatesTo, event.content[@"m.relates_to"]);
if ([relatesTo[@"m.in_reply_to"] isKindOfClass:NSDictionary.class])
{
html = [self renderReplyTo:html];
}
Expand Down