branch: elpa/mastodon
commit 226abdd48081270625d7c04107c36cac06d5fb4d
Author: marty hiatt <martianhia...@disroot.org>
Commit: marty hiatt <martianhia...@disroot.org>

    byline/profile: fix handling of empty display_name string
---
 lisp/mastodon-profile.el |  5 ++++-
 lisp/mastodon-tl.el      | 10 +++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index c603ee4d94..0b911d87b7 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -710,7 +710,10 @@ MAX-ID is a flag to include the max_id pagination 
parameter."
              (mastodon-profile--image-from-account account 'header_static)
              "\n"
              (when .display_name
-               (propertize .display_name 'face 'mastodon-display-name-face))
+               (propertize (if (string-empty-p .display_name)
+                               .username
+                             .display_name)
+                           'face 'mastodon-display-name-face))
              ;; roles
              (when .roles
                (concat " " (mastodon-profile--render-roles .roles)))
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index c257ad5655..50b0e826b0 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -647,11 +647,11 @@ is extracted from it."
   (let ((data (or (alist-get 'account toot)
                   toot))) ;; grouped nofifs use account data directly
     (let-alist data
-      (let ((disp (mastodon-tl--unicode-wrap .display_name)))
-        (propertize (if (and .display_name
-                             (not (string-empty-p disp)))
-                        disp
-                      .username)
+      (let ((disp (if (and .display_name
+                           (not (string-empty-p .display_name)))
+                      (mastodon-tl--unicode-wrap .display_name)
+                    .username)))
+        (propertize disp
                     'face 'mastodon-display-name-face
                     ;; enable playing of videos when point is on byline:
                     ;; 'attachments (mastodon-tl--get-attachments-for-byline 
toot)

Reply via email to