diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-12-10 23:59:50 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-12-10 23:59:50 +0200 |
commit | ef0b0f68795786751b04615451d42dbd7b3d7a5d (patch) | |
tree | a04f4677032d054d803e0a67929fbfe4d46eb87a /src/ChatPage.cc | |
parent | Add gui option for joining rooms (#25) (diff) | |
download | nheko-ef0b0f68795786751b04615451d42dbd7b3d7a5d.tar.xz |
Add menu to invite users
Diffstat (limited to 'src/ChatPage.cc')
-rw-r--r-- | src/ChatPage.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 25b8fe66..dfae487d 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -109,6 +109,13 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent) connect( top_bar_, &TopRoomBar::leaveRoom, this, [=]() { client_->leaveRoom(current_room_); }); + connect(top_bar_, &TopRoomBar::inviteUsers, this, [=](QStringList users) { + for (int ii = 0; ii < users.size(); ++ii) { + QTimer::singleShot(ii * 1000, this, [=]() { + client_->inviteUser(current_room_, users.at(ii)); + }); + } + }); connect(room_list_, &RoomList::roomChanged, this, [=](const QString &roomid) { QStringList users; @@ -258,6 +265,9 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent) connect(client_.data(), &MatrixClient::joinedRoom, this, [=]() { emit showNotification("You joined the room."); }); + connect(client_.data(), &MatrixClient::invitedUser, this, [=](QString, QString user) { + emit showNotification(QString("Invited user %1").arg(user)); + }); connect(client_.data(), &MatrixClient::leftRoom, this, &ChatPage::removeRoom); showContentTimer_ = new QTimer(this); |