mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Save chat moderation state in splits
This commit is contained in:
parent
3f41dfeff9
commit
9ca4befd9b
|
@ -516,6 +516,7 @@ void WindowManager::encodeNodeRecusively(SplitNode *node, QJsonObject &obj)
|
||||||
case SplitNode::_Split:
|
case SplitNode::_Split:
|
||||||
{
|
{
|
||||||
obj.insert("type", "split");
|
obj.insert("type", "split");
|
||||||
|
obj.insert("moderationMode", node->getSplit()->getModerationMode());
|
||||||
QJsonObject split;
|
QJsonObject split;
|
||||||
encodeChannel(node->getSplit()->getIndirectChannel(), split);
|
encodeChannel(node->getSplit()->getIndirectChannel(), split);
|
||||||
obj.insert("data", split);
|
obj.insert("data", split);
|
||||||
|
|
|
@ -689,6 +689,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
||||||
auto *split = new Split(this);
|
auto *split = new Split(this);
|
||||||
split->setChannel(
|
split->setChannel(
|
||||||
WindowManager::decodeChannel(obj.value("data").toObject()));
|
WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||||
|
split->setModerationMode(obj.value("moderationMode").toBool(false));
|
||||||
|
|
||||||
this->appendSplit(split);
|
this->appendSplit(split);
|
||||||
}
|
}
|
||||||
|
@ -711,6 +712,8 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
||||||
auto *split = new Split(this);
|
auto *split = new Split(this);
|
||||||
split->setChannel(WindowManager::decodeChannel(
|
split->setChannel(WindowManager::decodeChannel(
|
||||||
_obj.value("data").toObject()));
|
_obj.value("data").toObject()));
|
||||||
|
split->setModerationMode(
|
||||||
|
_obj.value("moderationMode").toBool(false));
|
||||||
|
|
||||||
Node *_node = new Node();
|
Node *_node = new Node();
|
||||||
_node->parent_ = node;
|
_node->parent_ = node;
|
||||||
|
|
Loading…
Reference in a new issue