1#pragma once
2
3/// @file
4/// @brief Alias events.
5
6#include <string>
7#include <vector>
8
9#if __has_include(<nlohmann/json_fwd.hpp>)
10#include <nlohmann/json_fwd.hpp>
11#else
12#include <nlohmann/json.hpp>
13#endif
14
15namespace mtx {
16namespace events {
17namespace state {
18
19//! Content for the `m.room.aliases` event.
20//
21//! This event is sent by a homeserver directly to inform of changes to
22//! the list of aliases it knows about for that room. The `state_key`
23//! for this event is set to the homeserver which owns the room alias.
24//! The entire set of known aliases for the room is the union of all
25//! the `m.room.aliases` events, one for each homeserver.
26struct Aliases
27{
28 //! A list of room aliases.
29 std::vector<std::string> aliases;
30
31 //! Deserialization method needed by @p nlohmann::json.
32 friend void from_json(const nlohmann::json &obj, Aliases &content);
33
34 //! Serialization method needed by @p nlohmann::json.
35 friend void to_json(nlohmann::json &obj, const Aliases &content);
36};
37
38} // namespace state
39} // namespace events
40} // namespace mtx
41