From 9f5982e1800bafd80c029f9a2ce77a3ca75e7cfe Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 4 Jun 2024 00:18:38 +0200 Subject: [PATCH] Prevent opening empty profiles Should fix 1707 --- src/timeline/TimelineViewManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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);