aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-08-31 15:10:52 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-08-31 15:10:52 +0200
commit81bc0978fd36a17d2e0fba4123754ccc2af9035d (patch)
tree4b56f1485e4f83558b2ca6770dce458315888868
parent6f7c564d90b7d477ef600a9ffb742faaaf38d3fb (diff)
set default visibility fun
-rw-r--r--lisp/mastodon-profile.el9
-rw-r--r--lisp/mastodon-toot.el4
2 files changed, 13 insertions, 0 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index 6fe3e14..0c91556 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -70,6 +70,7 @@
(defvar mastodon-tl--buffer-spec)
(defvar mastodon-tl--update-point)
(defvar mastodon-mode-map)
+(defvar mastodon-toot-visibility-list)
(defvar-local mastodon-profile--account nil
"The data for the account being described in the current profile buffer.")
@@ -263,6 +264,14 @@ SOURCE means that the preference is in the 'source' part of the account json."
(lambda ()
(message "Account setting %s updated!" pref)))))
+(defun mastodon-profile-set-default-toot-visibility ()
+ "Set the default visibility for toots."
+ (interactive)
+ (let ((vis (completing-read "Set default visibility to:"
+ mastodon-toot-visibility-list
+ nil t)))
+ (mastodon-profile--update-preference "privacy" vis :source)))
+
(defun mastodon-profile-view-preferences ()
"View user preferences in another window."
(interactive)
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 253fb5d..8d8b9f3 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -126,6 +126,10 @@ This is only used if company mode is installed."
(defvar-local mastodon-toot--content-nsfw nil
"A flag indicating whether the toot should be marked as NSFW.")
+(defvar mastodon-toot-visibility-list
+ '(direct private unlisted public)
+ "A list of the available toot visibility settings.")
+
(defvar-local mastodon-toot--visibility "public"
"A string indicating the visibility of the toot being composed.