[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 11fc4f01c4 057/116: re-do display of card (link)
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 11fc4f01c4 057/116: re-do display of card (link) author. #596 |
Date: |
Mon, 21 Oct 2024 13:00:49 -0400 (EDT) |
branch: elpa/mastodon
commit 11fc4f01c4934e5d687382f3ccb301cb8343a6d9
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
re-do display of card (link) author. #596
---
lisp/mastodon-tl.el | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 3f06756894..c4abbf0d97 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -886,6 +886,7 @@ links in the text. If TOOT is nil no parsing occurs."
(car region) (cdr region)
(get-text-property (car region)
'shr-url))
(when (proper-list-p toot) ;; not on profile fields cons cells
+ ;; render card author maybe:
(let* ((card (alist-get 'card toot))
(card-url (alist-get 'url card))
(authors (alist-get 'authors card))
@@ -894,7 +895,7 @@ links in the text. If TOOT is nil no parsing occurs."
(when (and (string= url-no-query card-url)
;; only if we have an account's data:
(alist-get 'account (car authors)))
- (goto-char (point-max)) ;;(cdr region))
+ (goto-char (point-max))
(mastodon-tl--insert-card-authors authors)))))))
(buffer-string))))
@@ -903,17 +904,30 @@ links in the text. If TOOT is nil no parsing occurs."
(insert
(concat
"\n(Authors: "
- (cl-loop for x in authors
- concat
- (mastodon-tl--format-card-author x))
+ (mapconcat #'mastodon-tl--format-card-author authors "\n")
")\n")))
(defun mastodon-tl--format-card-author (data)
"Render card author DATA."
;; FIXME: update as needed, data contains "name" "url" and "account"
- (let-alist data
- (when .account
- (mastodon-search--propertize-user .account))))
+ (when (alist-get 'account data) ;.account
+ (let-alist (alist-get 'account data) ;.account
+ ;; FIXME: replace with refactored handle render fun
+ ;; in byline refactor branch:
+ (concat
+ (propertize .username
+ 'face 'mastodon-display-name-face
+ 'byline t
+ 'item-type 'user
+ 'item-id .id)
+ " "
+ (propertize (concat "@" .acct)
+ 'face 'mastodon-handle-face
+ 'mouse-face 'highlight
+ 'mastodon-tab-stop 'user-handle
+ 'keymap mastodon-tl--link-keymap
+ 'mastodon-handle (concat "@" .acct)
+ 'help-echo (concat "Browse user profile of @" .acct))))))
(defun mastodon-tl--process-link (toot start end url)
"Process link URL in TOOT as hashtag, userhandle, or normal link.
- [nongnu] elpa/mastodon abe02e818d 116/116: Merge branch 'develop', (continued)
- [nongnu] elpa/mastodon abe02e818d 116/116: Merge branch 'develop', ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 91058026d2 095/116: notifs: handle actions fixed via user-handles-get, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon d5d6a71ce5 009/116: layout of fields transient, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 7d84df4f64 016/116: cmd index, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon ba6e063616 021/116: move call to mastodon-media--inline-images, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon d3f7046a08 023/116: transient: improve field-dot-to-array, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 119bca6c44 042/116: add mastodon-notifications--action-alist, use reblog in notifications.el, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 6d20b69857 039/116: Merge branch 'develop' into unread-notifs, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon fbcec02f90 044/116: 1st mockup of grouped notifs, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 652c17da29 061/116: card authors tiny clean up. #596., ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 11fc4f01c4 057/116: re-do display of card (link) author. #596,
ELPA Syncer <=
- [nongnu] elpa/mastodon 17bcc1ff76 062/116: byline: help echo timestamps in numbers, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 390c1d0c2d 099/116: bump version, copyright, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 9aeb84f4fd 108/116: flychecks, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon cfe4703513 105/116: notifs: remove stale notifs code from tl--insert-status, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon e87f997e12 112/116: change order of toot-visibility-list for sane cycling, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 1c1a195b09 025/116: fix display/links of Media: links with captions, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 353afcad0f 041/116: WIP. display fediverse account of link authors if available., ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon d74004b02d 076/116: flycheck -tl.el, ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 3c3ef2e98f 084/116: notifs: improve insert-note text props. fixes pagination (hack), ELPA Syncer, 2024/10/21
- [nongnu] elpa/mastodon 94a7083c28 082/116: flycheck, ELPA Syncer, 2024/10/21