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

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

[nongnu] elpa/mastodon b6676c180b 27/50: tl: improve ctrl flow in --spoi


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon b6676c180b 27/50: tl: improve ctrl flow in --spoiler + --toot
Date: Sat, 2 Nov 2024 13:00:54 -0400 (EDT)

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

    tl: improve ctrl flow in --spoiler + --toot
---
 lisp/mastodon-tl.el | 38 +++++++++++++++++---------------------
 1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index cfd99067c1..a5bd2e0203 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1275,25 +1275,22 @@ FILTER is a string to use as a filter warning spoiler 
instead."
          (cw (mastodon-tl--set-face message 'mastodon-cw-face)))
     (concat
      cw
-     (propertize (mastodon-tl--content toot)
-                 'invisible
-                 (if filter
-                     t
-                   (let ((cust mastodon-tl--expand-content-warnings))
-                     (cond ((eq t cust)
-                            nil)
-                           ((eq nil cust)
-                            t)
-                           ((eq 'server cust)
-                            (unless (eq t
-                                        ;; If something goes wrong reading 
prefs,
-                                        ;; just return nil so CWs show by 
default.
-                                        (condition-case nil
-                                            
(mastodon-profile--get-preferences-pref
-                                             'reading:expand:spoilers)
-                                          (error nil)))
-                              t)))))
-                 'mastodon-content-warning-body t))))
+     (propertize
+      (mastodon-tl--content toot)
+      'invisible
+      (or filter ;; filters = invis
+          (let ((cust mastodon-tl--expand-content-warnings))
+            (if (not (eq 'server cust))
+                (not cust) ;; opp to setting
+              ;; respect server setting:
+              (not
+               ;; If something goes wrong reading prefs,
+               ;; just return nil so CWs show by default.
+               (condition-case nil
+                   (mastodon-profile--get-preferences-pref
+                    'reading:expand:spoilers)
+                 (error nil))))))
+      'mastodon-content-warning-body t))))
 
 
 ;;; MEDIA
@@ -1792,8 +1789,7 @@ NO-CW means treat content warnings as unfolded."
                                  (mastodon-tl--content toot)))))
     ;; If any filters are "hide", then we hide,
     ;; even though item may also have a "warn" filter:
-    (if (and filtered (assoc "hide" filters))
-        nil ;; no insert
+    (unless (and filtered (assoc "hide" filters)) ;; no insert
       (mastodon-tl--insert-status
        toot (mastodon-tl--clean-tabs-and-nl spoiler-or-content)
        #'mastodon-tl--byline-boost nil nil detailed-p



reply via email to

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