summary refs log tree commit diff
path: root/src/Cache_p.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-13 00:08:58 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-13 00:08:58 +0200
commit9ae7d0dce3d78cefc0498e2322117ef00c6ec2e8 (patch)
tree50b328c9f25402ee3d84b1adfb902a01da58f6e6 /src/Cache_p.h
parentInitialize Profile later (diff)
downloadnheko-9ae7d0dce3d78cefc0498e2322117ef00c6ec2e8.tar.xz
Readd pagination and fix redactions
Diffstat (limited to 'src/Cache_p.h')
-rw-r--r--src/Cache_p.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h
index 6b4b260e..1d6d62dd 100644
--- a/src/Cache_p.h
+++ b/src/Cache_p.h
@@ -179,8 +179,8 @@ public:
         };
         Messages getTimelineMessages(lmdb::txn &txn,
                                      const std::string &room_id,
-                                     int64_t index = std::numeric_limits<int64_t>::max(),
-                                     bool forward  = false);
+                                     uint64_t index = std::numeric_limits<uint64_t>::max(),
+                                     bool forward   = false);
 
         std::optional<mtx::events::collections::TimelineEvent> getEvent(
           const std::string &room_id,
@@ -190,12 +190,15 @@ public:
                         const mtx::events::collections::TimelineEvent &event);
         struct TimelineRange
         {
-                int64_t first, last;
+                uint64_t first, last;
         };
         std::optional<TimelineRange> getTimelineRange(const std::string &room_id);
-        std::optional<int64_t> getTimelineIndex(const std::string &room_id,
-                                                std::string_view event_id);
-        std::optional<std::string> getTimelineEventId(const std::string &room_id, int64_t index);
+        std::optional<uint64_t> getTimelineIndex(const std::string &room_id,
+                                                 std::string_view event_id);
+        std::optional<std::string> getTimelineEventId(const std::string &room_id, uint64_t index);
+
+        std::string previousBatchToken(const std::string &room_id);
+        uint64_t saveOldMessages(const std::string &room_id, const mtx::responses::Messages &res);
 
         //! Remove old unused data.
         void deleteOldMessages();