Better rich reply.

This commit is contained in:
Black Hat
2018-11-27 18:14:48 +08:00
parent cc5ba20375
commit e7b2698521
6 changed files with 42 additions and 34 deletions

View File

@@ -261,7 +261,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const {
const auto &evt = isPending ? **pendingIt : **timelineIt;
if (role == Qt::DisplayRole) {
return utils::eventToString(evt, m_currentRoom, Qt::RichText);
return utils::removeReply(utils::eventToString(evt, m_currentRoom, Qt::RichText));
}
if (role == MessageRole) {
@@ -389,7 +389,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const {
case ReplyEventIdRole:
return replyEventId;
case ReplyDisplayRole:
return utils::eventToString(replyEvt, m_currentRoom, Qt::RichText);
return utils::removeReply(utils::eventToString(replyEvt, m_currentRoom, Qt::RichText));
case ReplyAuthorRole:
return QVariant::fromValue(
m_currentRoom->user(replyEvt.senderId()));