Add some Userprofile buttons

This commit is contained in:
CH Chethan Reddy 2020-06-26 04:24:42 +05:30
parent 75efa5d3a2
commit 00e36b6068
5 changed files with 145 additions and 46 deletions

View file

@ -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);
}