Debian Codegraph @

mtxclient/include/mtx/events/messages/unknown.hpp

raw symbols SCIP
1 #pragma once
2
3 /// @file
4 /// @brief An unknown message. According to the spec, this must have a text fallback.
5
6 #if __has_include(<nlohmann/json_fwd.hpp>)
7 #include <nlohmann/json_fwd.hpp>
8 #else
9 #include <nlohmann/json.hpp>
10 #endif
11
12 #include <string>
13
14 #include "mtx/events/common.hpp"
15
16 namespace mtx {
17 namespace events {
18 //! Non-state events sent in the timeline like messages.
19 namespace msg {
20
21 //! Content of `m.room.message` with an unrecognized msgtype.
22 struct Unknown
23 {
24 //! The body of the message.
25 std::string body;
26 //! The message type.
27 std::string msgtype;
28 //! Relates to for rich replies
29 mtx::common::Relations relations;
30 //! The original content of the message.
31 std::string content;
32
33 //! Mentioned users by this event
34 std::optional<mtx::common::Mentions> mentions;
35
36 friend void from_json(const nlohmann::json &obj, Unknown &content);
37 friend void to_json(nlohmann::json &obj, const Unknown &content);
38 };
39
40 } // namespace msg
41 } // namespace events
42 } // namespace mtx