aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-06 02:07:23 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-06 02:07:37 +0200
commitfc4d55f8464779e0912be771973ebd94a27df951 (patch)
tree333e2becf3c966faac74ad99538b87a8c6874916
parent476bf47b41a231f00b6be6e54b2728803741e88c (diff)
Matrix: remove unecessary m.room.power_levels from state sync
-rw-r--r--TODO1
-rw-r--r--include/AsyncTask.hpp2
-rw-r--r--src/plugins/Matrix.cpp4
3 files changed, 3 insertions, 4 deletions
diff --git a/TODO b/TODO
index 348723c..113aec8 100644
--- a/TODO
+++ b/TODO
@@ -187,7 +187,6 @@ Posting on bant doesn't work for some reason. The request is sent successfully b
4chan_pass cookie is needed to get captcha without slider. How to get this without an account? 4chan website sets this for anon too.
Handle replaces_state in matrix to get correct order for states?
Handle users_default power level in matrix.
-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.
diff --git a/include/AsyncTask.hpp b/include/AsyncTask.hpp
index 45b3397..e256dc7 100644
--- a/include/AsyncTask.hpp
+++ b/include/AsyncTask.hpp
@@ -57,7 +57,7 @@ namespace QuickMedia {
future.get();
}
} else {
- T result;
+ T result = T();
if(thread.joinable()) {
thread.join();
result = std::move(future.get());
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 6d6724a..64796eb 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -31,8 +31,8 @@ namespace QuickMedia {
static const char* OTHERS_ROOM_TAG = "tld.name.others";
// Filter without account data
static const char* INITIAL_FILTER = "{\"presence\":{\"limit\":0,\"types\":[\"\"]},\"account_data\":{\"limit\":0,\"types\":[\"\"]},\"room\":{\"state\":{\"not_types\":[\"m.room.related_groups\",\"m.room.power_levels\",\"m.room.join_rules\",\"m.room.history_visibility\"],\"lazy_load_members\":true},\"timeline\":{\"types\":[\"m.room.message\"],\"limit\":1,\"lazy_load_members\":true},\"ephemeral\":{\"limit\":0,\"types\":[\"\"],\"lazy_load_members\":true},\"account_data\":{\"limit\":1,\"types\":[\"m.fully_read\",\"m.tag\",\"qm.last_read_message_timestamp\"],\"lazy_load_members\":true}}}";
- static const char* ADDITIONAL_MESSAGES_FILTER = "{\"presence\":{\"limit\":0,\"types\":[\"\"]},\"account_data\":{\"limit\":0,\"types\":[\"\"]},\"room\":{\"state\":{\"not_types\":[\"m.room.related_groups\",\"m.room.join_rules\",\"m.room.history_visibility\"],\"lazy_load_members\":true},\"timeline\":{\"limit\":20,\"lazy_load_members\":true},\"ephemeral\":{\"limit\":0,\"types\":[\"\"],\"lazy_load_members\":true},\"account_data\":{\"limit\":0,\"types\":[\"\"],\"lazy_load_members\":true}}}";
- static const char* CONTINUE_FILTER = "{\"presence\":{\"limit\":0,\"types\":[\"\"]},\"account_data\":{\"limit\":0,\"types\":[\"\"]},\"room\":{\"state\":{\"not_types\":[\"m.room.related_groups\",\"m.room.join_rules\",\"m.room.history_visibility\"],\"lazy_load_members\":true},\"timeline\":{\"lazy_load_members\":true},\"ephemeral\":{\"limit\":0,\"types\":[\"\"],\"lazy_load_members\":true},\"account_data\":{\"types\":[\"m.fully_read\",\"m.tag\",\"qm.last_read_message_timestamp\"],\"lazy_load_members\":true}}}";
+ static const char* ADDITIONAL_MESSAGES_FILTER = "{\"presence\":{\"limit\":0,\"types\":[\"\"]},\"account_data\":{\"limit\":0,\"types\":[\"\"]},\"room\":{\"state\":{\"not_types\":[\"m.room.related_groups\",\"m.room.power_levels\",\"m.room.join_rules\",\"m.room.history_visibility\"],\"lazy_load_members\":true},\"timeline\":{\"limit\":20,\"lazy_load_members\":true},\"ephemeral\":{\"limit\":0,\"types\":[\"\"],\"lazy_load_members\":true},\"account_data\":{\"limit\":0,\"types\":[\"\"],\"lazy_load_members\":true}}}";
+ static const char* CONTINUE_FILTER = "{\"presence\":{\"limit\":0,\"types\":[\"\"]},\"account_data\":{\"limit\":0,\"types\":[\"\"]},\"room\":{\"state\":{\"not_types\":[\"m.room.related_groups\",\"m.room.power_levels\",\"m.room.join_rules\",\"m.room.history_visibility\"],\"lazy_load_members\":true},\"timeline\":{\"lazy_load_members\":true},\"ephemeral\":{\"limit\":0,\"types\":[\"\"],\"lazy_load_members\":true},\"account_data\":{\"types\":[\"m.fully_read\",\"m.tag\",\"qm.last_read_message_timestamp\"],\"lazy_load_members\":true}}}";
static std::string capitalize(const std::string &str) {
if(str.size() >= 1)