aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-05 12:18:29 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-05 12:18:29 +0200
commitc35fc22c4ca2a77bfc7317d3b8f78acabb855631 (patch)
tree6e373b0a2b63889ea9d465be37aaaa6f3fc8cfd7
parenta0c0f0bd551155270b11ac23c7f1c526a20a44b9 (diff)
Matrix: fix editing hidden events being visible
-rw-r--r--TODO3
-rw-r--r--include/BodyItem.hpp2
-rw-r--r--src/Body.cpp2
-rw-r--r--src/plugins/Matrix.cpp2
-rw-r--r--src/plugins/youtube/YoutubeMediaProxy.cpp2
5 files changed, 6 insertions, 5 deletions
diff --git a/TODO b/TODO
index ef7080e..348723c 100644
--- a/TODO
+++ b/TODO
@@ -191,4 +191,5 @@ Remove power_levels from sync and request them manually when entering a room.
Synapse is gay and mentions do not actually include the whole mxid. It only includes the username part of it. This conflicts with quickmedia notification and mentions where quickmedia includes the mxid in the mention instead,
while the user might have disable username mentions. In those cases the user wont get a notification for mxid mention. Mention name instead?
Make it possible to redact invites.
-Reapply filter when changing body item text. \ No newline at end of file
+Reapply filter when changing body item text.
+When fetching previous messages in matrix, ignore user info updates. \ No newline at end of file
diff --git a/include/BodyItem.hpp b/include/BodyItem.hpp
index ed53908..728c2b0 100644
--- a/include/BodyItem.hpp
+++ b/include/BodyItem.hpp
@@ -127,7 +127,7 @@ namespace QuickMedia {
// TODO: Use a list of strings instead, not all plugins need all of these fields
std::string url;
std::string thumbnail_url;
- bool visible;
+ bool visible; // TODO: Make private and when set by user, set a |visible_force| variable to true or false which makes the item invisible even after filtering
bool dirty;
bool dirty_description;
bool dirty_author;
diff --git a/src/Body.cpp b/src/Body.cpp
index 6e01266..766542a 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -1691,6 +1691,8 @@ namespace QuickMedia {
}
void Body::apply_search_filter_for_item(BodyItem *body_item) {
+ if(current_filter.empty())
+ return;
filter_search_fuzzy_item(current_filter, body_item);
}
}
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index f072a27..7257416 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -748,7 +748,6 @@ namespace QuickMedia {
tag_body_item->url = tag;
tag_body_items_by_name.insert(std::make_pair(tag, TagData{tag_body_item, {}}));
// TODO: Sort by tag priority
- body->apply_search_filter_for_item(tag_body_item.get());
body->append_item(tag_body_item);
tag_data = &tag_body_items_by_name[tag];
tag_data->tag_item = tag_body_item;
@@ -853,7 +852,6 @@ namespace QuickMedia {
void MatrixInvitesPage::add_body_item(std::shared_ptr<BodyItem> body_item) {
// TODO: Insert in reverse order (to show the latest invite at the top?)
- body->apply_search_filter_for_item(body_item.get());
body->insert_item_by_timestamp(std::move(body_item));
if(body->get_num_items() != prev_invite_count) {
prev_invite_count = body->get_num_items();
diff --git a/src/plugins/youtube/YoutubeMediaProxy.cpp b/src/plugins/youtube/YoutubeMediaProxy.cpp
index ed38981..e67a920 100644
--- a/src/plugins/youtube/YoutubeMediaProxy.cpp
+++ b/src/plugins/youtube/YoutubeMediaProxy.cpp
@@ -20,7 +20,7 @@ namespace QuickMedia {
static const int MAX_BUFFER_SIZE = 65536;
static const int RANGE = 524287;
static const int64_t THROTTLED_DOWNLOAD_LIMIT_KB = 80; // TODO: What about people with really slow internet? What if the video player cache is not working and download is stuck, leading to false download speed calculation?
- static const int64_t THROTTLED_DURATION_SECS = 3;
+ static const int64_t THROTTLED_DURATION_SECS = 2;
static const char download_error_response_msg[] =
"HTTP/1.1 500 Internal Server Error\r\n"
"Content-Length: 0\r\n\r\n";