From 2946b558101a22dd0770a2548f938ada86475256 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Sun, 5 Feb 2017 14:11:55 +0100 Subject: [PATCH] Make :sync() always add a "since" query parameter if available ...which ensures that multiple consecutive requests to /sync paginate properly. --- matrix/client.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matrix/client.lua b/matrix/client.lua index 5f10cc3..dcac037 100644 --- a/matrix/client.lua +++ b/matrix/client.lua @@ -435,7 +435,9 @@ function Client:_sync(options) if not options then options = {} end - options.since = self._sync_next_batch + if not options.since then + options.since = self._sync_next_batch + end self._log("sync: Requesting with next_batch = %s", options.since) local response = self._api:sync(options)