aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJeremy Dormitzer <jeremy.dormitzer@gmail.com>2018-08-18 08:24:53 -0400
committerJohnson Denen <johnson.denen@gmail.com>2019-03-04 22:44:28 -0500
commit087712709a2cd1082f3fdd9691897ef67515ad3c (patch)
treeb0d3968977b3fe8c5bd30f088397e8315988568c /lisp
parent6d622b53ae5d5815e2104d9b38a559ae77cbcbf0 (diff)
Add ability to change the visibility
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-toot.el17
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 9ef2a93..93538e4 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -90,7 +90,7 @@ Valid values are \"direct\", \"private\", \"unlisted\", and \"public\".")
(defun mastodon-toot--action-success (marker byline-region remove)
"Insert/remove the text MARKER with 'success face in byline.
-BYLINE-REGION is a cons of start and end pos of the byline to be
+BYLINE-REGION is a cons of start and end pos of the byline to be
modified.
Remove MARKER if REMOVE is non-nil, otherwise add it."
(let ((inhibit-read-only t)
@@ -184,6 +184,16 @@ Remove MARKER if REMOVE is non-nil, otherwise add it."
(point-min))))
(buffer-substring (cdr header-region) (point-max))))
+(defun mastodon-toot--set-visibility (visibility)
+ "Sets the visiblity of the next toot"
+ (interactive
+ (list (completing-read "Visiblity: " '("public"
+ "unlisted"
+ "private"
+ "direct"))))
+ (setq mastodon-toot--visibility visibility)
+ (message "Visibility set to %s" visibility))
+
(defun mastodon-toot--send ()
"Kill new-toot buffer/window and POST contents to the Mastodon instance."
(interactive)
@@ -198,6 +208,7 @@ Remove MARKER if REMOVE is non-nil, otherwise add it."
("visibility" . ,mastodon-toot--visibility)
("sensitive" . ,(when mastodon-toot--content-nsfw
(symbol-name t)))
+ ("visibility" . ,mastodon-toot--visibility)
("spoiler_text" . ,spoiler))))
(if empty-toot-p
(message "Empty toot. Cowardly refusing to post this.")
@@ -209,8 +220,8 @@ Remove MARKER if REMOVE is non-nil, otherwise add it."
(defun mastodon-toot--process-local (acct)
"Adds domain to local ACCT and replaces the curent user name with \"\".
-Mastodon requires the full user@domain, even in the case of local accts.
-eg. \"user\" -> \"user@local.social \" (when local.social is the domain of the
+Mastodon requires the full user@domain, even in the case of local accts.
+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\" "