mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-21 18:50:47 +03:00
Prevent opening empty profiles
Should fix 1707
This commit is contained in:
parent
ce0e9624fe
commit
9f5982e180
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue