Skip to content
Snippets Groups Projects
Unverified Commit d558041f authored by Nicolas Werner's avatar Nicolas Werner Committed by GitHub
Browse files

Merge pull request #101 from ramajd/master

add default_payload to PusherData struct
parents 4f9709ec b30d3545
No related branches found
No related tags found
No related merge requests found
Pipeline #5622 failed
...@@ -10,11 +10,7 @@ ...@@ -10,11 +10,7 @@
#include <mtx/events/collections.hpp> #include <mtx/events/collections.hpp>
#include <mtx/identifiers.hpp> #include <mtx/identifiers.hpp>
#if __has_include(<nlohmann/json_fwd.hpp>)
#include <nlohmann/json_fwd.hpp>
#else
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#endif
namespace mtx { namespace mtx {
//! Namespace for request structs //! Namespace for request structs
...@@ -408,6 +404,8 @@ struct PusherData ...@@ -408,6 +404,8 @@ struct PusherData
//! defined in the Push Gateway Specification. Currently the only format available is //! defined in the Push Gateway Specification. Currently the only format available is
//! 'event_id_only'. //! 'event_id_only'.
std::string format; std::string format;
//! Push gateway specific data.
std::optional<nlohmann::json> default_payload;
friend void to_json(nlohmann::json &obj, const PusherData &data); friend void to_json(nlohmann::json &obj, const PusherData &data);
}; };
......
...@@ -267,6 +267,9 @@ to_json(json &obj, const PusherData &data) ...@@ -267,6 +267,9 @@ to_json(json &obj, const PusherData &data)
if (!data.format.empty()) { if (!data.format.empty()) {
obj["format"] = data.format; obj["format"] = data.format;
} }
if (data.default_payload) {
obj["default_payload"] = data.default_payload.value();
}
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment