Skip to content

Commit

Permalink
Merge pull request #5817 from vector-im/ismail/5816_reply_fallback
Browse files Browse the repository at this point in the history
Extend Reply Fallbacks to non-thread Events
  • Loading branch information
ismailgulek authored Mar 15, 2022
2 parents a0f45a2 + 07d734b commit 0d5bd23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ - (NSAttributedString *)attributedStringFromEvent:(MXEvent *)event withRoomState
isHTML =YES;
MXJSONModelSetString(body, event.content[@"formatted_body"]);
}
else if (eventThreadId && !RiotSettings.shared.enableThreads)
else if (event.isReplyEvent || (eventThreadId && !RiotSettings.shared.enableThreads))
{
NSString *repliedEventId = event.relatesTo.inReplyTo.eventId ?: eventThreadId;
isHTML = YES;
Expand Down Expand Up @@ -2067,7 +2067,7 @@ - (UIColor*)textColorForEvent:(MXEvent*)event
textColor = _errorTextColor;
}
// Check whether the message is highlighted.
else if (event.mxkIsHighlighted || (!RiotSettings.shared.enableThreads && event.isInThread && [event shouldBeHighlightedInSession:mxSession]))
else if (event.mxkIsHighlighted || (mxSession && [event shouldBeHighlightedInSession:mxSession]))
{
textColor = _bingTextColor;
}
Expand Down Expand Up @@ -2132,7 +2132,7 @@ - (UIFont*)fontForEvent:(MXEvent*)event string:(NSString*)string
{
font = _callNoticesTextFont;
}
else if (event.mxkIsHighlighted || (!RiotSettings.shared.enableThreads && event.isInThread && [event shouldBeHighlightedInSession:mxSession]))
else if (event.mxkIsHighlighted || (mxSession && [event shouldBeHighlightedInSession:mxSession]))
{
font = _bingTextFont;
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/5816.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MXKEventFormatter: Extend reply fallback for also non-thread events.

0 comments on commit 0d5bd23

Please sign in to comment.