Add support for non-highlight channel point rewards (#1809)

This commit is contained in:
Jonas Schmitt
2020-08-08 15:37:22 +02:00
committed by GitHub
parent 1bd3d10eef
commit 11b8948290
23 changed files with 498 additions and 25 deletions
+17
View File
@@ -28,5 +28,22 @@ namespace rj {
return std::string(buffer.GetString());
}
bool getSafeObject(rapidjson::Value &obj, const char *key,
rapidjson::Value &out)
{
if (!checkJsonValue(obj, key))
{
return false;
}
out = obj[key].Move();
return true;
}
bool checkJsonValue(const rapidjson::Value &obj, const char *key)
{
return obj.IsObject() && !obj.IsNull() && obj.HasMember(key);
}
} // namespace rj
} // namespace chatterino