diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-04 21:34:00 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-04 21:34:00 +0900 |
commit | 6a9de91752dfe75e185bf90ab856367b2c804582 (patch) | |
tree | 2a12ecc84bf0055e317ef2e4aeec3439d92b2035 /lib/csapi/definitions/push_rule.cpp | |
parent | d5397fe5ae2ca34d5cfb11394dac17728a2b50ce (diff) | |
parent | 5d1dd53890611376873f6f959e206d5a56cfff70 (diff) | |
download | libquotient-6a9de91752dfe75e185bf90ab856367b2c804582.tar.gz libquotient-6a9de91752dfe75e185bf90ab856367b2c804582.zip |
Merge branch 'kitsune-events-rewritten'
Diffstat (limited to 'lib/csapi/definitions/push_rule.cpp')
-rw-r--r-- | lib/csapi/definitions/push_rule.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/csapi/definitions/push_rule.cpp b/lib/csapi/definitions/push_rule.cpp index 98f5d788..833135ec 100644 --- a/lib/csapi/definitions/push_rule.cpp +++ b/lib/csapi/definitions/push_rule.cpp @@ -9,12 +9,12 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const PushRule& pod) { QJsonObject _json; - addParam<>(_json, "actions", pod.actions); - addParam<>(_json, "default", pod.isDefault); - addParam<>(_json, "enabled", pod.enabled); - addParam<>(_json, "rule_id", pod.ruleId); - addParam<IfNotEmpty>(_json, "conditions", pod.conditions); - addParam<IfNotEmpty>(_json, "pattern", pod.pattern); + addParam<>(_json, QStringLiteral("actions"), pod.actions); + addParam<>(_json, QStringLiteral("default"), pod.isDefault); + addParam<>(_json, QStringLiteral("enabled"), pod.enabled); + addParam<>(_json, QStringLiteral("rule_id"), pod.ruleId); + addParam<IfNotEmpty>(_json, QStringLiteral("conditions"), pod.conditions); + addParam<IfNotEmpty>(_json, QStringLiteral("pattern"), pod.pattern); return _json; } @@ -23,17 +23,17 @@ PushRule FromJson<PushRule>::operator()(const QJsonValue& jv) const auto& _json = jv.toObject(); PushRule result; result.actions = - fromJson<QVector<QVariant>>(_json.value("actions")); + fromJson<QVector<QVariant>>(_json.value("actions"_ls)); result.isDefault = - fromJson<bool>(_json.value("default")); + fromJson<bool>(_json.value("default"_ls)); result.enabled = - fromJson<bool>(_json.value("enabled")); + fromJson<bool>(_json.value("enabled"_ls)); result.ruleId = - fromJson<QString>(_json.value("rule_id")); + fromJson<QString>(_json.value("rule_id"_ls)); result.conditions = - fromJson<QVector<PushCondition>>(_json.value("conditions")); + fromJson<QVector<PushCondition>>(_json.value("conditions"_ls)); result.pattern = - fromJson<QString>(_json.value("pattern")); + fromJson<QString>(_json.value("pattern"_ls)); return result; } |