emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/mastodon 6112232a7a 14/18: check instance version for grou


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 6112232a7a 14/18: check instance version for grouped-notifs
Date: Thu, 21 Nov 2024 13:00:19 -0500 (EST)

branch: elpa/mastodon
commit 6112232a7ab09d79223dbd4f84dfc53cbeaa54e1
Author: marty hiatt <martianhiatus@disroot.org>
Commit: marty hiatt <martianhiatus@disroot.org>

    check instance version for grouped-notifs
---
 lisp/mastodon.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index c13c3ba349..d578ab1a80 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -370,6 +370,10 @@ FORCE means to fetch from the server in any case and update
       (setq mastodon-instance-data
             (mastodon-http--get-json (mastodon-http--api "instance")))))
 
+(defun mastodon-instance-version ()
+  "Return the version string of user's instance."
+  (alist-get 'version (mastodon-instance-data)))
+
 ;;;###autoload
 (defun mastodon-toot (&optional user reply-to-id reply-json)
   "Update instance with new toot. Content is captured in a new buffer.
@@ -397,7 +401,10 @@ MAX-ID is a request parameter for pagination."
      (when max-id
        `(("max_id" . ,(mastodon-tl--buffer-property 'max-id))))
      nil nil nil
-     (if (not mastodon-group-notifications)
+     (if (or (not mastodon-group-notifications)
+             ;; if version less than 1st grouped notifs release:
+             (< 4.3 (string-to-number
+                     (mastodon-instance-version))))
          "v1"
        "v2"))
     (with-current-buffer (get-buffer-create buffer)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]