diff options
-rw-r--r-- | lisp/mastodon-toot.el | 8 | ||||
-rw-r--r-- | test/mastodon-toot-tests.el | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 121a590..c19f8e3 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -808,10 +808,10 @@ eg. \"user\" -> \"user@local.social \" (when local.social is the domain of the mastodon-instance-url). eg. \"yourusername\" -> \"\" eg. \"feduser@fed.social\" -> \"feduser@fed.social\"." - (cond ((string-match-p "@" acct) (concat "@" acct " ")) ; federated acct + (cond ((string-match-p "@" acct) (concat "@" acct)) ; federated acct ((string= (mastodon-auth--user-acct) acct) "") ; your acct (t (concat "@" acct "@" ; local acct - (cadr (split-string mastodon-instance-url "/" t)) " ")))) + (cadr (split-string mastodon-instance-url "/" t)))))) (defun mastodon-toot--mentions (status) "Extract mentions from STATUS and process them into a string." @@ -821,11 +821,11 @@ eg. \"feduser@fed.social\" -> \"feduser@fed.social\"." (if boosted (alist-get 'mentions (alist-get 'reblog status)) (alist-get 'mentions status)))) - (mapconcat (lambda(x) (mastodon-toot--process-local + (string-trim (mapconcat (lambda(x) (mastodon-toot--process-local (alist-get 'acct x))) ;; reverse does not work on vectors in 24.5 (reverse (append mentions nil)) - ""))) + " ")))) (defun mastodon-toot--get-bounds (regex) "Get bounds of tag or handle before point using REGEX." diff --git a/test/mastodon-toot-tests.el b/test/mastodon-toot-tests.el index b88510c..5d4ef03 100644 --- a/test/mastodon-toot-tests.el +++ b/test/mastodon-toot-tests.el @@ -68,7 +68,7 @@ Even the local name \"local\" gets a domain name added." (mastodon-instance-url "https://local.social")) (should (string= (mastodon-toot--mentions mastodon-toot--multi-mention) - "@local@local.social @federated@federated.social @federated@federated.cafe ")))) + "@local@local.social @federated@federated.social @federated@federated.cafe")))) (ert-deftest mastodon-toot--multi-mentions-with-name () "Should build a correct mention string omitting self. @@ -80,7 +80,7 @@ mention string." (mastodon-instance-url "https://local.social")) (should (string= (mastodon-toot--mentions mastodon-toot--multi-mention) - "@federated@federated.social @federated@federated.cafe ")))) + "@federated@federated.social @federated@federated.cafe")))) (ert-deftest mastodon-toot--no-mention () "Should construct an empty mention string without mentions." |