aboutsummaryrefslogtreecommitdiff
path: root/plugins/Matrix.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Matrix.hpp')
-rw-r--r--plugins/Matrix.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp
index b2e1711..50f8c6b 100644
--- a/plugins/Matrix.hpp
+++ b/plugins/Matrix.hpp
@@ -25,6 +25,13 @@ namespace QuickMedia {
MessageType type;
};
+ struct MessageInfo {
+ int size = 0;
+ int w = 0;
+ int h = 0;
+ const char* mimetype = nullptr;
+ };
+
struct RoomData {
// Each room has its own list of user data, even if multiple rooms has the same user
// because users can have different display names and avatars in different rooms.
@@ -59,7 +66,10 @@ namespace QuickMedia {
PluginResult get_room_messages(const std::string &room_id, size_t start_index, BodyItems &result_items, size_t &num_new_messages);
SearchResult search(const std::string &text, BodyItems &result_items) override;
- PluginResult post_message(const std::string &room_id, const std::string &text);
+ // |url| should only be set when uploading media.
+ // TODO: Make api better.
+ PluginResult post_message(const std::string &room_id, const std::string &body, const std::string &url = "", MessageType msgtype = MessageType::TEXT, MessageInfo *info = nullptr);
+ PluginResult post_file(const std::string &room_id, const std::string &filepath);
PluginResult login(const std::string &username, const std::string &password, const std::string &homeserver, std::string &err_msg);
PluginResult load_and_verify_cached_session();