summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-09-03 19:51:50 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-09-16 23:49:17 +0200
commitb05c10102148a388a5abedc890db52abc70d71b5 (patch)
tree363429b6cd8613d7e9bb8deea1b4ff379b1b9c4a /src/timeline/TimelineModel.cpp
parentReenable top bar room settings menus on avatar or title clicks (diff)
downloadnheko-b05c10102148a388a5abedc890db52abc70d71b5.tar.xz
Fix null errors in qml
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index f596a587..32e9f92c 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -719,12 +719,6 @@ TimelineModel::formatDateSeparator(QDate date) const
         return date.toString(fmt);
 }
 
-QString
-TimelineModel::escapeEmoji(QString str) const
-{
-        return utils::replaceEmoji(str);
-}
-
 void
 TimelineModel::viewRawMessage(QString id) const
 {
@@ -1389,7 +1383,7 @@ TimelineModel::formatTypingUsers(const std::vector<QString> &users, QColor bg)
         QStringList uidWithoutLast;
 
         auto formatUser = [this, bg](const QString &user_id) -> QString {
-                auto uncoloredUsername = escapeEmoji(displayName(user_id));
+                auto uncoloredUsername = utils::replaceEmoji(displayName(user_id));
                 QString prefix =
                   QString("<font color=\"%1\">").arg(manager_->userColor(user_id, bg).name());
 
@@ -1439,7 +1433,7 @@ TimelineModel::formatJoinRuleEvent(QString id)
                 return "";
 
         QString user = QString::fromStdString(event->sender);
-        QString name = escapeEmoji(displayName(user));
+        QString name = utils::replaceEmoji(displayName(user));
 
         switch (event->content.join_rule) {
         case mtx::events::state::JoinRule::Public:
@@ -1464,7 +1458,7 @@ TimelineModel::formatGuestAccessEvent(QString id)
                 return "";
 
         QString user = QString::fromStdString(event->sender);
-        QString name = escapeEmoji(displayName(user));
+        QString name = utils::replaceEmoji(displayName(user));
 
         switch (event->content.guest_access) {
         case mtx::events::state::AccessState::CanJoin:
@@ -1489,7 +1483,7 @@ TimelineModel::formatHistoryVisibilityEvent(QString id)
                 return "";
 
         QString user = QString::fromStdString(event->sender);
-        QString name = escapeEmoji(displayName(user));
+        QString name = utils::replaceEmoji(displayName(user));
 
         switch (event->content.history_visibility) {
         case mtx::events::state::Visibility::WorldReadable:
@@ -1522,7 +1516,7 @@ TimelineModel::formatPowerLevelEvent(QString id)
                 return "";
 
         QString user = QString::fromStdString(event->sender);
-        QString name = escapeEmoji(displayName(user));
+        QString name = utils::replaceEmoji(displayName(user));
 
         // TODO: power levels rendering is actually a bit complex. work on this later.
         return tr("%1 has changed the room's permissions.").arg(name);
@@ -1551,7 +1545,7 @@ TimelineModel::formatMemberEvent(QString id)
         }
 
         QString user = QString::fromStdString(event->state_key);
-        QString name = escapeEmoji(displayName(user));
+        QString name = utils::replaceEmoji(displayName(user));
         QString rendered;
 
         // see table https://matrix.org/docs/spec/client_server/latest#m-room-member