Add more event types in eventToString().

Move eventToString() to SpectralRoom.
This commit is contained in:
Black Hat
2019-04-21 12:41:53 +08:00
parent fae602e7df
commit de3a8b9b69
8 changed files with 270 additions and 556 deletions

View File

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