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
|
void
|
||||||
TimelineViewManager::openInviteUsers(QString roomId)
|
TimelineViewManager::openInviteUsers(QString roomId)
|
||||||
{
|
{
|
||||||
|
if (!roomId.startsWith('!'))
|
||||||
|
return;
|
||||||
|
|
||||||
InviteesModel *model = new InviteesModel{rooms_->getRoomById(roomId).data()};
|
InviteesModel *model = new InviteesModel{rooms_->getRoomById(roomId).data()};
|
||||||
connect(model, &InviteesModel::accept, this, [this, model, roomId]() {
|
connect(model, &InviteesModel::accept, this, [this, model, roomId]() {
|
||||||
emit inviteUsers(roomId, model->mxids());
|
emit inviteUsers(roomId, model->mxids());
|
||||||
|
@ -243,6 +246,9 @@ TimelineViewManager::openInviteUsers(QString roomId)
|
||||||
void
|
void
|
||||||
TimelineViewManager::openGlobalUserProfile(QString userId)
|
TimelineViewManager::openGlobalUserProfile(QString userId)
|
||||||
{
|
{
|
||||||
|
if (!userId.startsWith('@'))
|
||||||
|
return;
|
||||||
|
|
||||||
UserProfile *profile = new UserProfile{QString{}, userId, this};
|
UserProfile *profile = new UserProfile{QString{}, userId, this};
|
||||||
QQmlEngine::setObjectOwnership(profile, QQmlEngine::JavaScriptOwnership);
|
QQmlEngine::setObjectOwnership(profile, QQmlEngine::JavaScriptOwnership);
|
||||||
emit openProfile(profile);
|
emit openProfile(profile);
|
||||||
|
|
Loading…
Reference in a new issue