aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 78ddac7..ee61c23 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -1770,7 +1770,7 @@ namespace QuickMedia {
return message;
}
- if(strcmp(type_json.GetString(), "m.room.message") == 0) {
+ if(strcmp(type_json.GetString(), "m.room.message") == 0 || strcmp(type_json.GetString(), "m.sticker") == 0) {
} else if(strcmp(type_json.GetString(), "m.room.member") == 0) {
std::string user_display_name = room_data->get_user_display_name(user);
@@ -1866,9 +1866,7 @@ namespace QuickMedia {
// TODO: Also show joins, leave, invites, bans, kicks, mutes, etc
- if(!content_type.IsString() || strcmp(content_type.GetString(), "m.text") == 0) {
- message->type = MessageType::TEXT;
- } else if(strcmp(content_type.GetString(), "m.image") == 0) {
+ if((content_type.IsString() && strcmp(content_type.GetString(), "m.image") == 0) || strcmp(type_json.GetString(), "m.sticker") == 0) {
const rapidjson::Value &url_json = GetMember(*content_json, "url");
if(!url_json.IsString() || strncmp(url_json.GetString(), "mxc://", 6) != 0)
return nullptr;
@@ -1877,6 +1875,8 @@ namespace QuickMedia {
message->thumbnail_url = message_content_extract_thumbnail_url(*content_json, homeserver);
message_content_extract_thumbnail_size(*content_json, message->thumbnail_size);
message->type = MessageType::IMAGE;
+ } else if(!content_type.IsString() || strcmp(content_type.GetString(), "m.text") == 0) {
+ message->type = MessageType::TEXT;
} else if(strcmp(content_type.GetString(), "m.video") == 0) {
const rapidjson::Value &url_json = GetMember(*content_json, "url");
if(!url_json.IsString() || strncmp(url_json.GetString(), "mxc://", 6) != 0)