Debian Codegraph @

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

raw symbols SCIP
1 #pragma once
2
3 /// @file
4 /// @brief A message with a fancy effect.
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 a msgtype used by Element to show a fancy effect.
22 struct ElementEffect
23 {
24 //! The body of the message.
25 std::string body;
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, ElementEffect &content);
38 friend void to_json(nlohmann::json &obj, const ElementEffect &content);
39 };
40
41 } // namespace msg
42 } // namespace events
43 } // namespace mtx