aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el25
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 23abb84..8d8b9f3 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -71,6 +71,7 @@
(autoload 'mastodon-tl--reload-timeline-or-profile "mastodon-tl")
(autoload 'mastodon-tl--toot-id "mastodon-tl")
(autoload 'mastodon-toot "mastodon")
+(autoload 'mastodon-profile--get-source-pref "mastodon-profile")
;; for mastodon-toot--translate-toot-text
(autoload 'mastodon-tl--content "mastodon-tl")
@@ -82,18 +83,6 @@
:prefix "mastodon-toot-"
:group 'mastodon)
-(defcustom mastodon-toot--default-visibility "public"
- "The default visibility for new toots.
-
-Must be one of \"public\", \"unlisted\", \"private\" (for
-followers-only), or \"direct\"."
- :group 'mastodon-toot
- :type '(choice
- (const :tag "public" "public")
- (const :tag "unlisted" "unlisted")
- (const :tag "followers only" "private")
- (const :tag "direct" "direct")))
-
(defcustom mastodon-toot--default-media-directory "~/"
"The default directory when prompting for a media file to upload."
:group 'mastodon-toot
@@ -137,11 +126,17 @@ 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.
Valid values are \"direct\", \"private\" (followers-only),
-\"unlisted\", and \"public\".")
+\"unlisted\", and \"public\".
+
+This may be set by the account setting on the server.")
(defvar-local mastodon-toot--media-attachments nil
"A list of the media attachments of the toot being composed.")
@@ -1030,11 +1025,15 @@ REPLY-JSON is the full JSON of the toot being replied to."
(switch-to-buffer-other-window buffer)
(text-mode)
(mastodon-toot-mode t)
+ ;; use toot visibility setting from the server:
+ (setq mastodon-toot--visibility
+ (mastodon-profile--get-source-pref 'privacy))
(unless buffer-exists
(mastodon-toot--display-docs-and-status-fields)
(mastodon-toot--setup-as-reply reply-to-user reply-to-id reply-json))
(unless mastodon-toot--max-toot-chars
(mastodon-toot--get-max-toot-chars))
+ ;; set up company backends:
(when (require 'company nil :noerror)
(when mastodon-toot--enable-completion
(set (make-local-variable 'company-backends)