Devtools: Implement changing room state

This commit is contained in:
Tobias Fella
2024-03-03 00:19:19 +01:00
parent d2695947ed
commit c344a3ee55
13 changed files with 236 additions and 33 deletions

View File

@@ -77,12 +77,14 @@ void StateKeysModel::setEventType(const QString &eventType)
loadState();
}
QByteArray StateKeysModel::stateEventJson(const QModelIndex &index)
QByteArray StateKeysModel::stateEventJson(const QString &type, const QString &stateKey)
{
const auto row = index.row();
const auto event = m_stateKeys[row];
const auto json = event->fullJson();
return QJsonDocument(json).toJson();
return QJsonDocument(m_room->currentState().get(type, stateKey)->fullJson()).toJson();
}
QByteArray StateKeysModel::stateEventContentJson(const QString &type, const QString &stateKey)
{
return QJsonDocument(m_room->currentState().get(type, stateKey)->contentJson()).toJson();
}
#include "moc_statekeysmodel.cpp"