Fix #108.
This commit is contained in:
@@ -267,7 +267,8 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const {
|
||||
const auto& evt = isPending ? **pendingIt : **timelineIt;
|
||||
|
||||
if (role == Qt::DisplayRole) {
|
||||
return utils::removeReply(m_currentRoom->eventToString(evt, Qt::RichText));
|
||||
return utils::cleanHTML(
|
||||
utils::removeReply(m_currentRoom->eventToString(evt, Qt::RichText)));
|
||||
}
|
||||
|
||||
if (role == MessageRole) {
|
||||
@@ -410,8 +411,8 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const {
|
||||
case ReplyEventIdRole:
|
||||
return replyEventId;
|
||||
case ReplyDisplayRole:
|
||||
return utils::removeReply(
|
||||
m_currentRoom->eventToString(replyEvt, Qt::RichText));
|
||||
return utils::cleanHTML(utils::removeReply(
|
||||
m_currentRoom->eventToString(replyEvt, Qt::RichText)));
|
||||
case ReplyAuthorRole:
|
||||
return QVariant::fromValue(m_currentRoom->user(replyEvt.senderId()));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ QString utils::removeReply(const QString& text) {
|
||||
return result;
|
||||
}
|
||||
|
||||
QString utils::cleanHTML(const QString& text, QMatrixClient::Room* room) {
|
||||
QString utils::cleanHTML(const QString& text) {
|
||||
QString result(text);
|
||||
result.replace(codePillRegExp, "<i>\\1</i>");
|
||||
result.replace(userPillRegExp, "<b>\\1</b>");
|
||||
|
||||
@@ -25,7 +25,7 @@ static const QRegularExpression userPillRegExp{
|
||||
QRegularExpression::DotMatchesEverythingOption};
|
||||
|
||||
QString removeReply(const QString& text);
|
||||
QString cleanHTML(const QString& text, QMatrixClient::Room* room);
|
||||
QString cleanHTML(const QString& text);
|
||||
} // namespace utils
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user