From b6184b5cc445a496397d1b90aac7634c775ca9ee Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 31 Jul 2022 22:54:30 +0200 Subject: bump version in boilerplate --- lisp/mastodon-async.el | 2 +- lisp/mastodon-auth.el | 2 +- lisp/mastodon-client.el | 2 +- lisp/mastodon-discover.el | 2 +- lisp/mastodon-http.el | 2 +- lisp/mastodon-inspect.el | 2 +- lisp/mastodon-media.el | 2 +- lisp/mastodon-notifications.el | 2 +- lisp/mastodon-profile.el | 2 +- lisp/mastodon-search.el | 2 +- lisp/mastodon-tl.el | 2 +- lisp/mastodon-toot.el | 2 +- lisp/mastodon.el | 6 +++--- 13 files changed, 15 insertions(+), 15 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 86547a1..8a08416 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017 Alex J. Griffith ;; Author: Alex J. Griffith ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 2f333b7..02799bf 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -4,7 +4,7 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 4fc8db7..f1dcd4f 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -4,7 +4,7 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 7046070..c246e8a 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 35fd070..4db18be 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1") (request "0.3.0")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index 15ee7ce..cbf6a8e 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index e5a1111..ace15b2 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 5de7354..4324e1b 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 6065bdd..81e9c6b 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1") (seq "1.0")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index cbb1fba..a1bc2dd 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Marty Hiatt ;; Author: Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 7aef0a1..d355783 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index d571b6e..f1f8212 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 49abe26..842738e 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -4,7 +4,7 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1") (request "0.3.2") (seq "1.0")) ;; Homepage: https://codeberg.org/martianh/mastodon.el @@ -28,8 +28,8 @@ ;;; Commentary: ;; mastodon.el is an Emacs client for Mastodon , -;; the federated microblogging social network. It is very much a work-in-progress, but -;; it is a labor of love. +;; the federated microblogging social network. It also works with Pleroma instances. +;; see the readme file at https://codeberg.org/martianh/mastodon.el for set up and usage details. ;;; Code: (require 'cl-lib) ; for `cl-some' call in mastodon -- cgit v1.2.3 From 04f7ff92335642969cf7202f7dc81ac8532684e9 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 3 Aug 2022 21:36:10 +0200 Subject: text-mode for update profile note --- lisp/mastodon-profile.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 81e9c6b..5748fa3 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -207,6 +207,7 @@ JSON is the data returned by the server." (buffer (get-buffer-create "*mastodon-update-profile*")) (inhibit-read-only t)) (switch-to-buffer-other-window buffer) + (text-mode) (setq-local header-line-format (propertize "Edit your profile note. C-c C-c to send, C-c C-k to cancel." -- cgit v1.2.3 From a74340a72789ed12011d3f8618449bbe515a7e77 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 3 Aug 2022 21:37:06 +0200 Subject: update discover bindings for profile followers/following --- lisp/mastodon-discover.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index c246e8a..c8a40c9 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -89,8 +89,8 @@ ("-" "zoom out" 'image-decrease-size) ("u" "copy URL" 'shr-maybe-probe-and-copy-url)) ("Profile view" - ("o" "Show following" mastodon-profile--open-following) - ("O" "Show followers" mastodon-profile--open-followers) + ("g" "Show following" mastodon-profile--open-following) + ("s" "Show followers" mastodon-profile--open-followers) ("R" "View follow requests" mastodon-profile--view-follow-requests) ("a" "Accept follow request" mastodon-profile--follow-request-accept) -- cgit v1.2.3 From 3ff8f250c3a0e0ab0670cf7af72a2607950e4b5e Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 8 Aug 2022 16:10:13 +0200 Subject: re-allow boost/fave of own toots! --- lisp/mastodon-toot.el | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index f1f8212..897bf67 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -240,26 +240,27 @@ TYPE is a symbol, either 'favourite or 'boost." (remove (if boost-p (when boosted t) (when faved t))) (toot-type (alist-get 'type (mastodon-tl--property 'toot-json)))) (if byline-region - (cond ((mastodon-toot--own-toot-p (mastodon-tl--property 'toot-json)) - (error "You can't %s your own toots." action-string)) - ((equal "reblog" toot-type) - (error "You can't %s boosts." action-string)) - ((equal "favourite" toot-type) - (error "Your can't %s favourites." action-string)) - (t - (mastodon-toot--action - action - (lambda () - (let ((inhibit-read-only t)) - (add-text-properties (car byline-region) - (cdr byline-region) - (if boost-p - (list 'boosted-p (not boosted)) - (list 'favourited-p (not faved)))) - (mastodon-toot--action-success - (if boost-p "B" "F") - byline-region remove)) - (message (format "%s #%s" (if boost-p msg action) id)))))) + (cond ;; actually there's nothing wrong with faving/boosting own toots! + ;;((mastodon-toot--own-toot-p (mastodon-tl--property 'toot-json)) + ;;(error "You can't %s your own toots." action-string)) + ((equal "reblog" toot-type) + (error "You can't %s boosts." action-string)) + ((equal "favourite" toot-type) + (error "Your can't %s favourites." action-string)) + (t + (mastodon-toot--action + action + (lambda () + (let ((inhibit-read-only t)) + (add-text-properties (car byline-region) + (cdr byline-region) + (if boost-p + (list 'boosted-p (not boosted)) + (list 'favourited-p (not faved)))) + (mastodon-toot--action-success + (if boost-p "B" "F") + byline-region remove)) + (message (format "%s #%s" (if boost-p msg action) id)))))) (message (format "Nothing to %s here?!?" action-string))))) (defun mastodon-toot--toggle-boost () -- cgit v1.2.3 From e4443ee61505b82f967dd4cb2d2cb5af999d4a41 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 10 Aug 2022 14:57:19 +0200 Subject: fix formatting of unmute-user --- lisp/mastodon-tl.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index d355783..bbad5de 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1444,7 +1444,8 @@ by `mastodon-tl--follow-user' to enable or disable notifications." ((string-equal notify "false") (message "Not receiving notifications for user %s (@%s)!" name user-handle)) - ((string-equal action "mute") + ((or (string-equal action "mute") + (string-equal action "unmute")) (message "User %s (@%s) %sd!" name user-handle action)) ((eq notify nil) (message "User %s (@%s) %sed!" name user-handle action))))))) -- cgit v1.2.3 From b8838b8a2fb8932227c4daf2cf823ad9d0e1eea6 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 19 Aug 2022 09:21:39 +0200 Subject: tl--init*: fix a stray bracket --- lisp/mastodon-tl.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index bbad5de..249c4a8 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1688,14 +1688,13 @@ JSON is the data returned from the server." #'mastodon-tl--update-timestamps-callback (current-buffer) nil))) - (unless - ;; for everything save profiles: - (string-prefix-p "accounts" endpoint)) - ;;(or (equal endpoint "notifications") - ;; (string-prefix-p "timelines" endpoint) - ;; (string-prefix-p "favourites" endpoint) - ;; (string-prefix-p "statuses" endpoint)) - (mastodon-tl--goto-first-item))) + (unless (string-prefix-p "accounts" endpoint) + ;; for everything save profiles + (mastodon-tl--goto-first-item)))) +;;(or (equal endpoint "notifications") +;; (string-prefix-p "timelines" endpoint) +;; (string-prefix-p "favourites" endpoint) +;; (string-prefix-p "statuses" endpoint)) (defun mastodon-tl--init-sync (buffer-name endpoint update-function) "Initialize BUFFER-NAME with timeline targeted by ENDPOINT. -- cgit v1.2.3 From 7146bddc60712f3b6cff67514894d0057df31469 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 29 Aug 2022 16:05:54 +0200 Subject: RET on byline to view profile. - no more need to tab to handle --- lisp/mastodon-profile.el | 10 +++++++++- lisp/mastodon-tl.el | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 4b541fd..516059e 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -436,6 +436,14 @@ If toot is a boost, opens the profile of the booster." (message "Loading your profile...") (mastodon-profile--show-user (mastodon-auth--get-account-name))) +(defun mastodon-profile--view-author-profile () + "View the profile of author of present toot." + (interactive) + (let* ((toot-json (mastodon-tl--property 'toot-json)) + (acct (alist-get 'account toot-json)) + (handle (alist-get 'acct acct))) + (mastodon-profile--show-user handle))) + (defun mastodon-profile--account-field (account field) "Return FIELD from the ACCOUNT. @@ -494,7 +502,7 @@ These include the author, author of reblogged entries and any user mentioned." (when status (let ((this-account (or (alist-get 'account status) ; status is a toot - status)) ; status is a user listing + status)) ; status is a user listing (mentions (or (alist-get 'mentions (alist-get 'status status)) (alist-get 'mentions status))) (reblog (or (alist-get 'reblog (alist-get 'status status)) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 45e7282..079af22 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -65,6 +65,7 @@ (autoload 'mastodon-search--insert-users-propertized "mastodon-search") (autoload 'mastodon-search--get-user-info "mastodon-search") (autoload 'mastodon-http--delete "mastodon-http") +(autoload 'mastodon-profile--view-author-profile "mastodon-profile") (when (require 'mpv nil :no-error) (declare-function mpv-start "mpv")) @@ -196,9 +197,10 @@ types of mastodon links and not just shr.el-generated ones.") (when (require 'mpv nil :no-error) (let ((map (make-sparse-keymap))) (define-key map (kbd "") 'mastodon-tl--mpv-play-video-from-byline) + (define-key map (kbd "") 'mastodon-profile--view-author-profile) (keymap-canonicalize map))) "The keymap to be set for the author byline. -The idea is that you can play media without navigating to it.") +It is active where point is placed by `mastodon-tl--goto-next-toot.'") (defun mastodon-tl--next-tab-item () "Move to the next interesting item. -- cgit v1.2.3 From b4c8bcfbbf776783b11644f8917409d143d84962 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 30 Aug 2022 09:21:04 +0200 Subject: autoload for search-tags-query for tags completion --- lisp/mastodon-toot.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index be3aaad..23abb84 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -60,6 +60,7 @@ (autoload 'mastodon-http--read-file-as-string "mastodon-http") (autoload 'mastodon-http--triage "mastodon-http") (autoload 'mastodon-search--search-accounts-query "mastodon-search") +(autoload 'mastodon-search--search-tags-query "mastodon-search") (autoload 'mastodon-tl--as-string "mastodon-tl") (autoload 'mastodon-tl--clean-tabs-and-nl "mastodon-tl") (autoload 'mastodon-tl--field "mastodon-tl") -- cgit v1.2.3 From efe31d5230a0c310bdc1e2d53ca30c8123aaede2 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 30 Aug 2022 23:24:22 +0200 Subject: clear notification(s) functions --- lisp/mastodon-notifications.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lisp') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 0d11fb4..9986ede 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -268,5 +268,33 @@ of the toot responded to." "notifications" 'mastodon-notifications--timeline)) +(defun mastodon-notifications-clear () + "Clear all notifications." + (interactive) + (let ((response + (mastodon-http--post (mastodon-http--api "notifications/clear") + nil nil))) + (mastodon-http--triage + response (lambda () + (when mastodon-tl--buffer-spec + (mastodon-tl--reload-timeline-or-profile)) + (message "All notifications cleared!"))))) + +(defun mastodon-notifications-clear-current-notif () + "Dismiss the notification at point." + (interactive) + (let* ((id (or (mastodon-tl--property 'toot-id) + (mastodon-tl--field 'id + (mastodon-tl--property 'toot-json)))) + (response + (mastodon-http--post (mastodon-http--api + (format "notifications/%s/dismiss" id)) + nil nil))) + (mastodon-http--triage + response (lambda () + (when mastodon-tl--buffer-spec + (mastodon-tl--reload-timeline-or-profile)) + (message "Notification dismissed!"))))) + (provide 'mastodon-notifications) ;;; mastodon-notifications.el ends here -- cgit v1.2.3