aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Matrix.hpp3
-rw-r--r--src/plugins/Matrix.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp
index 66ca0a8..9378a9f 100644
--- a/plugins/Matrix.hpp
+++ b/plugins/Matrix.hpp
@@ -26,7 +26,8 @@ namespace QuickMedia {
mgl::Color user_id_to_color(const std::string &user_id);
// |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);
+ // |image_max_size| 0, 0 means no max size
+ std::string message_to_qm_text(Matrix *matrix, const Message *message, bool allow_formatted_text = true, mgl::vec2i image_max_size = mgl::vec2i(0, 0));
struct TimestampedDisplayData {
std::string data;
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index e53cf71..17d4735 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -633,15 +633,15 @@ namespace QuickMedia {
return nullptr;
}
- std::string message_to_qm_text(Matrix *matrix, const Message *message, bool allow_formatted_text) {
+ std::string message_to_qm_text(Matrix *matrix, const Message *message, bool allow_formatted_text, mgl::vec2i image_max_size) {
if(message->body_is_formatted)
- return formatted_text_to_qm_text(matrix, message->body.c_str(), message->body.size(), allow_formatted_text);
+ return formatted_text_to_qm_text(matrix, message->body.c_str(), message->body.size(), allow_formatted_text, image_max_size);
else
return message->body;
}
static std::string message_to_room_description_text(Matrix *matrix, Message *message, mgl::vec2i image_max_size = mgl::vec2i(0, 0)) {
- std::string body = strip(formatted_text_to_qm_text(matrix, message->body.c_str(), message->body.size(), true, image_max_size));
+ std::string body = strip(message_to_qm_text(matrix, message, true, image_max_size));
if(message->type == MessageType::REACTION)
return "Reacted with: " + body;
else if(message->related_event_type == RelatedEventType::REPLY)