Input field fixes

* Message with multiple mentions are not broken in IRC. Fix #267
* Editing a message won't remove mentions anymore


(cherry picked from commit bb3b3bc088)
This commit is contained in:
Carl Schwan
2021-02-22 19:09:56 +00:00
parent ffe9026830
commit 2f06d45589
8 changed files with 57 additions and 18 deletions

View File

@@ -538,12 +538,12 @@ QString msgTypeToString(MessageEventType msgType)
}
}
void NeoChatRoom::postMessage(const QString &text, MessageEventType type, const QString &replyEventId, const QString &relateToEventId)
void NeoChatRoom::postMessage(const QString &rawText, const QString &text, MessageEventType type, const QString &replyEventId, const QString &relateToEventId)
{
const auto html = markdownToHTML(text);
QString cleanText(text);
cleanText.replace(QRegularExpression("\\[(.+)\\]\\(.+\\)"), "\\1");
postHtmlMessage(cleanText, html, type, replyEventId, relateToEventId);
postHtmlMessage(rawText, html, type, replyEventId, relateToEventId);
}
void NeoChatRoom::postHtmlMessage(const QString &text, const QString &html, MessageEventType type, const QString &replyEventId, const QString &relateToEventId)