aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-11 10:50:39 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-11 10:50:39 +0100
commitd274d3a6dfc0864ec6a44e7d6948c2d873eb6f76 (patch)
treea4308da3afd0e7c567c40f8a26ab1bdcbc58a898 /plugins
parent25f6303ae40e9245f42545d120efa8b6f9be98d7 (diff)
Add image (custom emoji) alt text for copy-pasting, limit custom emoji size in room description, change max size to 32, 32, cache custom emoji locally
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Matrix.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp
index 3613709..66ca0a8 100644
--- a/plugins/Matrix.hpp
+++ b/plugins/Matrix.hpp
@@ -24,7 +24,8 @@ namespace QuickMedia {
std::string extract_first_line_remove_newline_elipses(const std::string &str, size_t max_length);
mgl::Color user_id_to_color(const std::string &user_id);
- std::string formatted_text_to_qm_text(Matrix *matrix, const char *str, size_t size, bool allow_formatted_text);
+ // |image_max_size| 0, 0 means no max size
+ std::string formatted_text_to_qm_text(Matrix *matrix, const char *str, size_t size, bool allow_formatted_text, mgl::vec2i image_max_size = mgl::vec2i(0, 0));
std::string message_to_qm_text(Matrix *matrix, const Message *message, bool allow_formatted_text = true);
struct TimestampedDisplayData {
@@ -718,6 +719,8 @@ namespace QuickMedia {
PluginResult parse_notifications(const rapidjson::Value &notifications_json, std::function<void(const MatrixNotification&)> callback_func);
PluginResult parse_sync_account_data(const rapidjson::Value &account_data_json);
PluginResult parse_sync_room_data(const rapidjson::Value &rooms_json, bool is_additional_messages_sync, bool initial_sync);
+ void parse_custom_emoji(const rapidjson::Value &custom_emoji_json);
+ void load_custom_emoji_from_cache();
PluginResult get_previous_room_messages(RoomData *room_data, bool latest_messages, size_t &num_new_messages, bool *reached_end = nullptr);
void events_add_user_info(const rapidjson::Value &events_json, RoomData *room_data, int64_t timestamp);
std::shared_ptr<UserInfo> parse_user_info(const rapidjson::Value &json, const std::string &user_id, RoomData *room_data, int64_t timestamp);