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

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

[nongnu] elpa/mastodon 4d5b51ee72 15/18: check instance version for grou


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

branch: elpa/mastodon
commit 4d5b51ee7239e8a03a3ed540edba4b51e9b6362f
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 cdc88ebede..b8f6801e7f 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -377,6 +377,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.
@@ -404,7 +408,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]