aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-18 02:28:53 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-18 02:28:53 +0100
commit6ce1376869dfa560221085edbbfc0ac7cd7ef751 (patch)
tree41062e5d68899fa38fb512747dafc8a6235df5fb /src
parentbf544dfabcd87e7fe826307a9ee34cc684806023 (diff)
Matrix: implement m.sticker
Diffstat (limited to 'src')
-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)