Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
redaction.hpp 801 B
#pragma once

/// @file
/// @brief Events describing redactions and redacted content.

#if __has_include(<nlohmann/json_fwd.hpp>)
#include <nlohmann/json_fwd.hpp>
#else
#include <nlohmann/json.hpp>
#endif

#include <string>

namespace mtx {
namespace events {
namespace msg {

//! Content for the `m.room.redaction` state event.
struct Redaction
{
        //! The reason for the redaction, if any.
        std::string reason;
};

void
from_json(const nlohmann::json &obj, Redaction &event);

void
to_json(nlohmann::json &obj, const Redaction &event);

//! Stripped out content for redacted events.
struct Redacted
{};

inline void
from_json(const nlohmann::json &, Redacted &)
{}

inline void
to_json(nlohmann::json &, const Redacted &)
{}

} // namespace msg
} // namespace events
} // namespace mtx