summary refs log tree commit diff
path: root/src/ChatPage.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-02-25 12:54:08 +0000
committerGitHub <noreply@github.com>2021-02-25 12:54:08 +0000
commit4c71ca811031365684bbee59de2b56599f90001b (patch)
tree4524afe74d1daee0a69f345eb35e2319eb27c72f /src/ChatPage.cpp
parentFix text input restoring after edits (diff)
parentchange mtxclient url, fix login page assert failure and dendrite registration... (diff)
downloadnheko-4c71ca811031365684bbee59de2b56599f90001b.tar.xz
Merge pull request #494 from Jedi18/minor_issue_fixes
Fix registration bug and navigate to created room
Diffstat (limited to 'src/ChatPage.cpp')
-rw-r--r--src/ChatPage.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp

index 9ba2cc87..aae9271d 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp
@@ -253,6 +253,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent) this, &ChatPage::updateGroupsInfo, communitiesList_, &CommunitiesList::setCommunities); connect(this, &ChatPage::leftRoom, this, &ChatPage::removeRoom); + connect(this, &ChatPage::newRoom, this, &ChatPage::changeRoom, Qt::QueuedConnection); connect(this, &ChatPage::notificationsRetrieved, this, &ChatPage::sendNotifications); connect(this, &ChatPage::highlightedNotifsRetrieved, @@ -967,8 +968,9 @@ ChatPage::createRoom(const mtx::requests::CreateRoom &req) return; } - emit showNotification( - tr("Room %1 created.").arg(QString::fromStdString(res.room_id.to_string()))); + QString newRoomId = QString::fromStdString(res.room_id.to_string()); + emit showNotification(tr("Room %1 created.").arg(newRoomId)); + emit newRoom(newRoomId); }); } @@ -990,6 +992,13 @@ ChatPage::leaveRoom(const QString &room_id) } void +ChatPage::changeRoom(const QString &room_id) +{ + view_manager_->setHistoryView(room_id); + room_list_->highlightSelectedRoom(room_id); +} + +void ChatPage::inviteUser(QString userid, QString reason) { auto room = current_room_;