summary refs log tree commit diff
path: root/src/ui/UserProfile.cpp
diff options
context:
space:
mode:
authorCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-06-26 04:24:42 +0530
committerCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-07-30 22:10:27 +0530
commit00e36b6068786d64812135a4d505501134ebc214 (patch)
tree993101bcce906249d98b11f8cef31bc22447950c /src/ui/UserProfile.cpp
parentFix the Weird auto-confirmation and cancellation (diff)
downloadnheko-00e36b6068786d64812135a4d505501134ebc214.tar.xz
Add some Userprofile buttons
Diffstat (limited to 'src/ui/UserProfile.cpp')
-rw-r--r--src/ui/UserProfile.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ui/UserProfile.cpp b/src/ui/UserProfile.cpp

index 588d6969..6aa4deff 100644 --- a/src/ui/UserProfile.cpp +++ b/src/ui/UserProfile.cpp
@@ -1,4 +1,5 @@ #include "UserProfile.h" +#include "ChatPage.h" #include "Logging.h" #include "Utils.h" #include "mtx/responses/crypto.hpp" @@ -86,3 +87,30 @@ UserProfile::updateDeviceList() { fetchDeviceList(this->userId); } + +void +UserProfile::banUser() +{ + ChatPage::instance()->banUser(this->userId, ""); +} + +// void ignoreUser(){ + +// } + +void +UserProfile::kickUser() +{ + ChatPage::instance()->kickUser(this->userId, ""); +} + +void +UserProfile::startChat() +{ + mtx::requests::CreateRoom req; + req.preset = mtx::requests::Preset::PrivateChat; + req.visibility = mtx::requests::Visibility::Private; + if (utils::localUser() != this->userId) + req.invite = {this->userId.toStdString()}; + emit ChatPage::instance()->createRoom(req); +}