ui almost looks the same, midway between transition from old room settings to new room settings
This commit is contained in:
parent
37679ac57e
commit
b70f37194f
12 changed files with 112 additions and 37 deletions
33
src/ui/RoomSettings.cpp
Normal file
33
src/ui/RoomSettings.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include "RoomSettings.h"
|
||||
|
||||
#include <mtx/responses/common.hpp>
|
||||
#include <mtx/responses/media.hpp>
|
||||
|
||||
#include "Cache.h"
|
||||
#include "Logging.h"
|
||||
|
||||
RoomSettings::RoomSettings(QString roomid, QObject *parent)
|
||||
: roomid_{std::move(roomid)}
|
||||
, QObject(parent)
|
||||
{
|
||||
retrieveRoomInfo();
|
||||
}
|
||||
|
||||
QString
|
||||
RoomSettings::roomName() const
|
||||
{
|
||||
return QString(info_.name.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
RoomSettings::retrieveRoomInfo()
|
||||
{
|
||||
try {
|
||||
usesEncryption_ = cache::isRoomEncrypted(roomid_.toStdString());
|
||||
info_ = cache::singleRoomInfo(roomid_.toStdString());
|
||||
//setAvatar();
|
||||
} catch (const lmdb::error &) {
|
||||
nhlog::db()->warn("failed to retrieve room info from cache: {}",
|
||||
roomid_.toStdString());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue