summary refs log tree commit diff
path: root/src/ui/UserProfile.cpp
diff options
context:
space:
mode:
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); +}