From ef0b0f68795786751b04615451d42dbd7b3d7a5d Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 10 Dec 2017 23:59:50 +0200 Subject: Add menu to invite users --- src/ChatPage.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/ChatPage.cc') 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 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 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); -- cgit 1.5.1