summary refs log tree commit diff
path: root/src/RoomsModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-06-16 01:49:51 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-06-17 03:14:48 +0200
commit28acea55e2efd76dd85bba4f343a668c3015db3b (patch)
tree68f43d66ea938357d7e4649daaf5dbc661811045 /src/RoomsModel.cpp
parentTranslated using Weblate (Finnish) (diff)
downloadnheko-28acea55e2efd76dd85bba4f343a668c3015db3b.tar.xz
Remove redundant alias function
Diffstat (limited to 'src/RoomsModel.cpp')
-rw-r--r--src/RoomsModel.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/RoomsModel.cpp b/src/RoomsModel.cpp
index 782c4971..68cfaf1b 100644
--- a/src/RoomsModel.cpp
+++ b/src/RoomsModel.cpp
@@ -23,17 +23,19 @@ RoomsModel::RoomsModel(bool showOnlyRoomWithAliases, QObject *parent)
     }
 
     for (const auto &r : rooms_) {
-        auto roomAliasesList = cache::client()->getRoomAliases(r);
+        auto roomAliasesList =
+          cache::client()->getStateEvent<mtx::events::state::CanonicalAlias>(r);
 
         if (showOnlyRoomWithAliases_) {
-            if (roomAliasesList && !roomAliasesList->alias.empty()) {
+            if (roomAliasesList && !roomAliasesList->content.alias.empty()) {
                 roomids.push_back(QString::fromStdString(r));
-                roomAliases.push_back(QString::fromStdString(roomAliasesList->alias));
+                roomAliases.push_back(QString::fromStdString(roomAliasesList->content.alias));
             }
         } else {
             roomids.push_back(QString::fromStdString(r));
-            roomAliases.push_back(roomAliasesList ? QString::fromStdString(roomAliasesList->alias)
-                                                  : QLatin1String(""));
+            roomAliases.push_back(roomAliasesList
+                                    ? QString::fromStdString(roomAliasesList->content.alias)
+                                    : QLatin1String(""));
         }
     }
 }