aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-16 14:48:26 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-16 14:48:26 +0100
commit4e3a32ea4478e547215c6775313aaded3bc16b08 (patch)
tree12a01077e0d2997663995d7c56648e15c74cba93
parent4eeaa5c2b889a22c23199247ccc87fb717e6cbcb (diff)
Matrix: do not continuously fetch messages when currently showing pinned messages tab
-rw-r--r--README.md2
-rw-r--r--TODO3
-rw-r--r--images/sprites-small.pngbin0 -> 1566335 bytes
-rw-r--r--src/QuickMedia.cpp3
-rw-r--r--src/plugins/Matrix.cpp5
5 files changed, 10 insertions, 3 deletions
diff --git a/README.md b/README.md
index 93144ec..c5554f2 100644
--- a/README.md
+++ b/README.md
@@ -84,6 +84,8 @@ See project.conf \[dependencies].
`waifu2x-ncnn-vulkan` needs to be installed when using the `--upscale-images` or `--upscale-images-always` option.\
`xdg-utils` which provides `xdg-open` needs to be installed when downloading torrents with `nyaa.si` plugin.\
`ffmpeg (and ffprobe which is included in ffmpeg)` needs to be installed to upload videos with thumbnails on matrix.
+## License
+QuickMedia is free software licensed under GPL 3.0. `images/sprites-small.png` is licensed under CC BY 4.0. Source for that image is available at https://github.com/EmojiTwo/emojitwo/
# Screenshots
## Youtube search
![](https://www.dec05eba.com/images/youtube.jpg)
diff --git a/TODO b/TODO
index ad7383f..9f95a34 100644
--- a/TODO
+++ b/TODO
@@ -130,4 +130,5 @@ Scroll tabs if there are more than 3 tab items and show arrow on left/right side
Make a shader for Text for changing color instead of updating the text geometry. Or loop vertices and set their color to the new color without updating the text geometry.
Automatically retry sending messages that fails to send (after timeout).
Also make message deletion provisional (make it gray while its deleting the message).
-Continue matrix requests when switching room, instead of resetting them when going from chat page to room list page (such as post message request). \ No newline at end of file
+Continue matrix requests when switching room, instead of resetting them when going from chat page to room list page (such as post message request).
+Pinned messages authors doesn't seem to be updated when fetching users, if the pinned messages are fetched before the users (by navigating to the pending messages tab quickly). \ No newline at end of file
diff --git a/images/sprites-small.png b/images/sprites-small.png
new file mode 100644
index 0000000..341a861
--- /dev/null
+++ b/images/sprites-small.png
Binary files differ
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index df2d63e..315fef0 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -4569,7 +4569,8 @@ namespace QuickMedia {
window.display();
- fetch_more_previous_messages_if_needed();
+ if(selected_tab == MESSAGES_TAB_INDEX)
+ fetch_more_previous_messages_if_needed();
if(matrix_chat_page->should_clear_data) {
matrix_chat_page->should_clear_data = false;
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index b102cfa..9da6185 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -274,6 +274,7 @@ namespace QuickMedia {
void RoomData::clear_data() {
std::lock_guard<std::recursive_mutex> lock(room_mutex);
//fetched_messages_by_event_id.clear();
+ userdata = nullptr;
user_info_by_user_id.clear();
messages.clear();
messages_read_index = 0;
@@ -460,7 +461,9 @@ namespace QuickMedia {
last_unread_message = last_new_message.get();
BodyItem *room_body_item = static_cast<BodyItem*>(room->userdata);
- assert(room_body_item);
+ //assert(room_body_item);
+ if(!room_body_item)
+ return;
if(last_unread_message) {
std::string room_desc = "Unread: " + matrix->message_get_author_displayname(last_unread_message) + ": " + extract_first_line_elipses(last_unread_message->body, 150);