Debian Codegraph @

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

raw symbols SCIP
1 #pragma once
2
3 /// @file
4 /// @brief Events describing an emotion or action.
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 namespace msg {
19
20 //! Content of `m.room.message` with msgtype `m.emote`.
21 struct Emote
22 {
23 // The emote action to perform.
24 std::string body;
25 // Must be 'm.emote'.
26 std::string msgtype;
27 //! We only handle org.matrix.custom.html.
28 std::string format;
29 //! HTML formatted message.
30 std::string formatted_body;
31 //! Relates to for rich replies
32 mtx::common::Relations relations;
33
34 //! Mentioned users by this event
35 std::optional<mtx::common::Mentions> mentions;
36
37 friend void from_json(const nlohmann::json &obj, Emote &content);
38 friend void to_json(nlohmann::json &obj, const Emote &content);
39 };
40
41 } // namespace msg
42 } // namespace events
43 } // namespace mtx