Debian Codegraph @

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

raw symbols SCIP
1 #pragma once
2
3 /// @file
4 /// @brief Audio messages.
5
6 #include <optional>
7 #include <string>
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
15 #include "mtx/common.hpp"
16 #include "mtx/events/common.hpp"
17
18 namespace mtx {
19 namespace events {
20 namespace msg {
21
22 //! Content of `m.room.message` with msgtype `m.audio`.
23 struct Audio
24 {
25 /// @brief A description of the audio or some kind of content description
26 /// for accessibility.
27 std::string body;
28 //! Must be 'm.audio'.
29 std::string msgtype;
30 //! The matrix URL of the audio clip.
31 std::string url;
32 //! Metadata for the audio clip referred to in url.
33 mtx::common::AudioInfo info;
34 //! Encryption members. If present, they replace url.
35 std::optional<crypto::EncryptedFile> file;
36 //! Relates to for rich replies
37 mtx::common::Relations relations;
38
39 //! Mentioned users by this event
40 std::optional<mtx::common::Mentions> mentions;
41
42 friend void from_json(const nlohmann::json &obj, Audio &content);
43 friend void to_json(nlohmann::json &obj, const Audio &content);
44 };
45
46 } // namespace msg
47 } // namespace events
48 } // namespace mtx