Save chat moderation state in splits

This commit is contained in:
ckath 2019-03-24 15:38:09 +01:00
parent 3f41dfeff9
commit 9ca4befd9b
2 changed files with 4 additions and 0 deletions

View file

@ -516,6 +516,7 @@ void WindowManager::encodeNodeRecusively(SplitNode *node, QJsonObject &obj)
case SplitNode::_Split:
{
obj.insert("type", "split");
obj.insert("moderationMode", node->getSplit()->getModerationMode());
QJsonObject split;
encodeChannel(node->getSplit()->getIndirectChannel(), split);
obj.insert("data", split);

View file

@ -689,6 +689,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
auto *split = new Split(this);
split->setChannel(
WindowManager::decodeChannel(obj.value("data").toObject()));
split->setModerationMode(obj.value("moderationMode").toBool(false));
this->appendSplit(split);
}
@ -711,6 +712,8 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
auto *split = new Split(this);
split->setChannel(WindowManager::decodeChannel(
_obj.value("data").toObject()));
split->setModerationMode(
_obj.value("moderationMode").toBool(false));
Node *_node = new Node();
_node->parent_ = node;