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

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

[nongnu] elpa/mastodon 47865bd215 30/52: tl--prev-toot-id: don't assume


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 47865bd215 30/52: tl--prev-toot-id: don't assume our funs return anything.
Date: Mon, 30 Oct 2023 16:01:26 -0400 (EDT)

branch: elpa/mastodon
commit 47865bd21551616d5d149afa6c574b2bfd0f118f
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>

    tl--prev-toot-id: don't assume our funs return anything.
    
    fixes a bug that would break thread loading, perhaps because an ancestor 
toot
    wasn't there when it was supposed to be, so we were check for prev id when
    there was no prev toot. maybe caused by viewing threads that include toots 
by
    ppl on blocked servers, which don't display.
---
 lisp/mastodon-tl.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 3e4e31ed8f..e279ee3286 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1303,10 +1303,13 @@ Runs `mastodon-tl--render-text' and fetches poll or 
media."
 
 (defun mastodon-tl--prev-item-id ()
   "Return the id of the last toot inserted into the buffer."
-  (let ((prev-pos
-         (1- (save-excursion
-               (previous-single-property-change (point) 'base-item-id)))))
-    (get-text-property prev-pos 'base-item-id)))
+  (let* ((prev-change
+          (save-excursion
+            (previous-single-property-change (point) 'base-toot-id)))
+         (prev-pos
+          (when prev-change (1- prev-change))))
+    (when prev-pos
+      (get-text-property prev-pos 'base-toot-id))))
 
 (defun mastodon-tl--after-reply-status (reply-to-id)
   "T if REPLY-TO-ID is equal to that of the last toot inserted in the bufer."



reply via email to

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