Skip to content

Commit

Permalink
Fix sending emotes or user pills in replies
Browse files Browse the repository at this point in the history
Change-Id: Idc47d2fcfb28359bda89308a8d830469991d268c
  • Loading branch information
SpiritCroc committed Jun 21, 2022
1 parent 59db6af commit 45b7d78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,10 @@ internal class LocalEchoEventFactory @Inject constructor(

val body = bodyForReply(eventReplied.getLastMessageContent(), eventReplied.isReply())

// For inline images and user pills
val replyTextProcessed = textPillsUtils.processSpecialSpansToHtml(replyText) ?: replyText
// As we always supply formatted body for replies we should force the MarkdownParser to produce html.
val replyTextFormatted = markdownParser.parse(replyText, force = true, advanced = autoMarkdown).takeFormatted()
val replyTextFormatted = markdownParser.parse(replyTextProcessed, force = true, advanced = autoMarkdown).takeFormatted()
// Body of the original message may not have formatted version, so may also have to convert to html.
val bodyFormatted = body.formattedText ?: markdownParser.parse(body.text, force = true, advanced = autoMarkdown).takeFormatted()
val replyFormatted = buildFormattedReply(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,13 @@ class MessageComposerViewModel @AssistedInject constructor(
state.rootThreadEventId?.let {
room.relationService().replyInThread(
rootThreadEventId = it,
replyInThreadText = action.text.toString(),
replyInThreadText = action.text,
autoMarkdown = action.autoMarkdown,
eventReplied = timelineEvent
)
} ?: room.relationService().replyToMessage(
eventReplied = timelineEvent,
replyText = action.text.toString(),
replyText = action.text,
autoMarkdown = action.autoMarkdown,
showInThread = showInThread,
rootThreadEventId = rootThreadEventId
Expand Down

0 comments on commit 45b7d78

Please sign in to comment.