Allow editing text and also hide edits from the timeline

This commit is contained in:
Carl Schwan
2020-12-28 09:37:17 +00:00
parent 9d82ebb0ed
commit c69d3587ba
8 changed files with 93 additions and 78 deletions

View File

@@ -167,7 +167,7 @@ QVariantMap ChatDocumentHandler::getAutocompletionInfo()
};
}
void ChatDocumentHandler::postMessage(const QString &text, const QString &attachementPath, const QString &replyEventId) const
void ChatDocumentHandler::postMessage(const QString &text, const QString &attachementPath, const QString &replyEventId, const QString &editEventId) const
{
if (!m_room || !m_document) {
return;
@@ -200,7 +200,7 @@ void ChatDocumentHandler::postMessage(const QString &text, const QString &attach
for (int i = 0; i < cleanedText.length(); i++) {
rainbowText = rainbowText % QStringLiteral("<font color='") % rainbowColors.at(i % rainbowColors.length()) % "'>" % cleanedText.at(i) % "</font>";
}
m_room->postHtmlMessage(cleanedText, rainbowText, messageEventType, replyEventId);
m_room->postHtmlMessage(cleanedText, rainbowText, messageEventType, replyEventId, editEventId);
return;
}
@@ -211,7 +211,7 @@ void ChatDocumentHandler::postMessage(const QString &text, const QString &attach
cleanedText = cleanedText.remove(0, noticePrefix.length());
messageEventType = RoomMessageEvent::MsgType::Notice;
}
m_room->postArbitaryMessage(cleanedText, messageEventType, replyEventId);
m_room->postMessage(cleanedText, messageEventType, replyEventId, editEventId);
}
void ChatDocumentHandler::replaceAutoComplete(const QString &word)