diff options
author | Alexander Griffith <griffitaj@gmail.com> | 2018-03-07 18:41:49 -0500 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2018-08-10 22:20:04 -0400 |
commit | 5de5012d01de70a2ebed496a90daa60e9b1a8481 (patch) | |
tree | c7194c49908b9e6b5ccda36fcd812974dd60c492 /lisp | |
parent | 02470346206894f0c261dc53447db4ac72700031 (diff) |
Fix missing thread notifications (#176)
* Print "No Thread\!" if there are no descendants or ancestors.
* Fixed errors for Reblog, follow and favourited notifications.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-tl.el | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 9fe58ae..b066608 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -652,18 +652,24 @@ webapp" (buffer (format "*mastodon-thread-%s*" id)) (toot (mastodon-tl--property 'toot-json)) (context (mastodon-http--get-json url))) - (with-output-to-temp-buffer buffer - (switch-to-buffer buffer) - (mastodon-mode) - (setq mastodon-tl--buffer-spec - `(buffer-name ,buffer - endpoint ,(format "statuses/%s/context" id) - update-function - (lambda(toot) (message "END of thread.")))) - (mastodon-tl--timeline (vconcat - (cdr (assoc 'ancestors context)) - `(,toot) - (cdr (assoc 'descendants context))))))) + (when (member (cdr (assoc 'type toot)) '("reblog" "favourite")) + (setq toot (cdr(assoc 'status toot)))) + (if (> (+ (length (cdr (assoc 'ancestors context))) + (length (cdr (assoc 'descendants context)))) + 0) + (with-output-to-temp-buffer buffer + (switch-to-buffer buffer) + (mastodon-mode) + (setq mastodon-tl--buffer-spec + `(buffer-name ,buffer + endpoint ,(format "statuses/%s/context" id) + update-function + (lambda(toot) (message "END of thread.")))) + (mastodon-tl--timeline (vconcat + (cdr (assoc 'ancestors context)) + `(,toot) + (cdr (assoc 'descendants context))))) + (message "No Thread!")))) (defun mastodon-tl--more () "Append older toots to timeline." |