Remove markdown links from 'body' of messages
- Markdown is not in the matrix spec - Clients use the 'body' text for things like notifications, which render these links as plain text
This commit is contained in:
@@ -529,7 +529,9 @@ QString msgTypeToString(MessageEventType msgType)
|
|||||||
void NeoChatRoom::postMessage(const QString &text, MessageEventType type, const QString &replyEventId, const QString &relateToEventId)
|
void NeoChatRoom::postMessage(const QString &text, MessageEventType type, const QString &replyEventId, const QString &relateToEventId)
|
||||||
{
|
{
|
||||||
const auto html = markdownToHTML(text);
|
const auto html = markdownToHTML(text);
|
||||||
postHtmlMessage(text, html, type, replyEventId, relateToEventId);
|
QString cleanText(text);
|
||||||
|
cleanText.replace(QRegularExpression("\\[(.+)\\]\\(.+\\)"), "\\1");
|
||||||
|
postHtmlMessage(cleanText, html, type, replyEventId, relateToEventId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NeoChatRoom::postHtmlMessage(const QString &text, const QString &html, MessageEventType type, const QString &replyEventId, const QString &relateToEventId)
|
void NeoChatRoom::postHtmlMessage(const QString &text, const QString &html, MessageEventType type, const QString &replyEventId, const QString &relateToEventId)
|
||||||
|
|||||||
Reference in New Issue
Block a user