From c65a57e884de51cade584e3f01c7c5627aa6ebd8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 Nov 2022 14:23:49 +0100 Subject: Matrix: fix edit being replaced with old message when re-entering the room (without restart) Add quote colors to 4chan, monospace for codeblocks --- plugins/Matrix.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 61814ac..4afe28e 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -21,10 +21,9 @@ namespace QuickMedia { static const int AUTHOR_MAX_LENGTH = 48; std::string remove_reply_formatting(const std::string &str); - std::string message_get_body_remove_formatting(Message *message); 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(const char *str, size_t size); + std::string formatted_text_to_qm_text(const char *str, size_t size, bool allow_formatted_text); struct TimestampedDisplayData { std::string data; @@ -234,7 +233,8 @@ namespace QuickMedia { using Rooms = std::vector; - bool message_contains_user_mention(const std::string &msg, const std::string &username); + bool message_contains_user_mention(const Message *message, const std::string &username, const std::string &user_id); + bool message_contains_user_mention(const BodyItem *body_item, const std::string &username, const std::string &user_id); bool message_is_timeline(Message *message); void body_set_selected_item_by_url(Body *body, const std::string &url); std::string create_transaction_id(); @@ -619,6 +619,7 @@ namespace QuickMedia { void append_system_message(RoomData *room_data, std::shared_ptr message); std::string body_to_formatted_body(RoomData *room, const std::string &body); + void on_exit_room(RoomData *room); // Calls the |MatrixDelegate| pending events. // Should be called from the main (ui) thread -- cgit v1.2.3