summary refs log tree commit diff
path: root/src/timeline/TimelineViewManager.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-06-04 00:18:38 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2024-06-04 00:19:20 +0200
commit9f5982e1800bafd80c029f9a2ce77a3ca75e7cfe (patch)
tree3fecca726f9cc13b4896a10444b52592f73cc232 /src/timeline/TimelineViewManager.cpp
parentUpdate translations (diff)
downloadnheko-9f5982e1800bafd80c029f9a2ce77a3ca75e7cfe.tar.xz
Prevent opening empty profiles
Should fix 1707
Diffstat (limited to '')
-rw-r--r--src/timeline/TimelineViewManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index bf2d987c..1b2635b0 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -232,6 +232,9 @@ TimelineViewManager::openRoomSettings(QString room_id)
 void
 TimelineViewManager::openInviteUsers(QString roomId)
 {
+    if (!roomId.startsWith('!'))
+        return;
+
     InviteesModel *model = new InviteesModel{rooms_->getRoomById(roomId).data()};
     connect(model, &InviteesModel::accept, this, [this, model, roomId]() {
         emit inviteUsers(roomId, model->mxids());
@@ -243,6 +246,9 @@ TimelineViewManager::openInviteUsers(QString roomId)
 void
 TimelineViewManager::openGlobalUserProfile(QString userId)
 {
+    if (!userId.startsWith('@'))
+        return;
+
     UserProfile *profile = new UserProfile{QString{}, userId, this};
     QQmlEngine::setObjectOwnership(profile, QQmlEngine::JavaScriptOwnership);
     emit openProfile(profile);