aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--src/plugins/Matrix.cpp8
2 files changed, 4 insertions, 5 deletions
diff --git a/TODO b/TODO
index bd57926..cabcb2e 100644
--- a/TODO
+++ b/TODO
@@ -135,5 +135,4 @@ Pinned messages authors doesn't seem to be updated when fetching users, if the p
Improve /sync by not removing cached data on initial sync, and also always append data to sync file instead of overwriting sync file on "initial sync". Also cache "since", but take into consideration that not all messages are fetched on the initial sync,
then add a gap between old messages from before sync and after sync so we can fetch the messages between the old messages and new messages and remove the gap when the fetched messages contains any of the old messages.
Fetching of previous messages should also be saved in the /sync file and messages fetched with get_message_by_id, which would cache embedded items and pinned messages; also cache users.
-Implement m.sticker.
If manga page fails to download then show "failed to download image" as text and bind F5 to refresh (retry download). \ No newline at end of file
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)