summary refs log tree commit diff
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
parentUpdate translations (diff)
downloadnheko-9f5982e1800bafd80c029f9a2ce77a3ca75e7cfe.tar.xz
Prevent opening empty profiles
Should fix 1707
-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);