diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-06-04 00:18:38 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-06-04 00:19:20 +0200 |
commit | 9f5982e1800bafd80c029f9a2ce77a3ca75e7cfe (patch) | |
tree | 3fecca726f9cc13b4896a10444b52592f73cc232 /src/timeline | |
parent | ce0e9624fe9dfffa1a6a1e60bb453dfb270b4917 (diff) |
Prevent opening empty profiles
Should fix 1707
Diffstat (limited to 'src/timeline')
-rw-r--r-- | src/timeline/TimelineViewManager.cpp | 6 |
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); |