diff options
author | martianh <martianh@noreply.codeberg.org> | 2022-02-12 15:39:20 +0100 |
---|---|---|
committer | martianh <martianh@noreply.codeberg.org> | 2022-02-12 15:39:20 +0100 |
commit | 8b20cae30e1064c49a5c95789270d975ee96d3ff (patch) | |
tree | 093c86448905fe1bcdc5f2c003a6d9cb1bf45e3c | |
parent | a7aaba52da9730f29fe796e242c6ee5c75f5f48c (diff) | |
parent | e5d73624023cb9bf0ec929985f35e935090b40f0 (diff) |
Merge pull request 'Fix the timers for auto-updating of relative timestamps.' (#257) from h_d/mastodon.el:fix-timers into develop
Reviewed-on: https://codeberg.org/martianh/mastodon.el/pulls/257
-rw-r--r-- | lisp/mastodon-tl.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 8921259..cdb4aa2 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1269,7 +1269,7 @@ is a no-op." ;; We need to re-schedule for an earlier time (cancel-timer mastodon-tl--timestamp-update-timer) (setq mastodon-tl--timestamp-update-timer - (run-at-time this-update + (run-at-time (time-to-seconds (time-subtract this-update (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) nil))))))) @@ -1322,7 +1322,9 @@ from the start if it is nil." (copy-marker previous-timestamp)) ;; otherwise we are done for now; schedule a new run for when needed (setq mastodon-tl--timestamp-update-timer - (run-at-time mastodon-tl--timestamp-next-update + (run-at-time (time-to-seconds + (time-subtract mastodon-tl--timestamp-next-update + (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback buffer nil)))))))) @@ -1372,7 +1374,9 @@ JSON is the data returned from the server." update-function ,update-function) mastodon-tl--timestamp-update-timer (when mastodon-tl--enable-relative-timestamps - (run-at-time mastodon-tl--timestamp-next-update + (run-at-time (time-to-seconds + (time-subtract mastodon-tl--timestamp-next-update + (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) @@ -1402,7 +1406,9 @@ Runs synchronously." ,update-function) mastodon-tl--timestamp-update-timer (when mastodon-tl--enable-relative-timestamps - (run-at-time mastodon-tl--timestamp-next-update + (run-at-time (time-to-seconds + (time-subtract mastodon-tl--timestamp-next-update + (current-time))) nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) |