From 00e36b6068786d64812135a4d505501134ebc214 Mon Sep 17 00:00:00 2001 From: CH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com> Date: Fri, 26 Jun 2020 04:24:42 +0530 Subject: Add some Userprofile buttons --- src/ui/UserProfile.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/ui/UserProfile.cpp') 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); +} -- cgit 1.5.1