aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-20 23:08:44 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-20 23:08:44 +0200
commitbd13b51eb83ef95d46960db920a8572766e91789 (patch)
tree878e4bde837890400d535f792d30c8f9bcfb8bd7
parent132b77f664eb0f82706b4bd16643fab62155e7fc (diff)
Stop fetching notifications at the end
-rw-r--r--TODO1
-rw-r--r--src/Body.cpp6
-rw-r--r--src/plugins/Matrix.cpp3
3 files changed, 7 insertions, 3 deletions
diff --git a/TODO b/TODO
index e4fbae0..963362c 100644
--- a/TODO
+++ b/TODO
@@ -75,7 +75,6 @@ Add functionality to ignore users in matrix. This is done with an ignore request
Add keybind to go to invites page from any page.
Show marker beside pinned messages tab name if there are new pinned messages.
Make /logout work everywhere, not only in room message input (or add a logout button to settings tab?).
-Add a notifications tab to show messages that mention us in all rooms (and then press enter to go to that message in that room), also add a unread/mentioned rooms list tab to only show rooms with unread messages or mentions.
Disable message input in matrix when muted.
Preview rooms?
Handle matrix token being invalidated while running.
diff --git a/src/Body.cpp b/src/Body.cpp
index 5a23694..9b6a5d8 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -280,8 +280,10 @@ namespace QuickMedia {
void Body::select_first_item() {
selected_scrolled = 0.0f;
selected_item = 0;
- prev_selected_item = selected_item;
- page_scroll = 0.0f;
+ if(attach_side == AttachSide::TOP) {
+ prev_selected_item = selected_item;
+ page_scroll = 0.0f;
+ }
clamp_selection();
clamp_selected_item_to_body_count = 1;
//item_background_target_pos_y = body_pos.y;
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 7992772..49a3988 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -1476,6 +1476,8 @@ namespace QuickMedia {
const rapidjson::Value &next_token_json = GetMember(json_root, "next_token");
if(next_token_json.IsString())
set_next_notifications_token(next_token_json.GetString());
+ else
+ set_next_notifications_token("invalid");
return PluginResult::OK;
}
@@ -2782,6 +2784,7 @@ namespace QuickMedia {
const rapidjson::Value &end_json = GetMember(json_root, "end");
if(!end_json.IsString()) {
+ room_data->set_prev_batch("invalid");
fprintf(stderr, "Warning: matrix messages response is missing 'end', this could happen if we received the very first messages in the room\n");
return PluginResult::OK;
}