From 96f4b3627b3cbb38b28ba07206fb6196e71e212a Mon Sep 17 00:00:00 2001 From: Johnson Denen Date: Sat, 8 Apr 2017 07:23:07 -0400 Subject: Refactor authorization --- lisp/mastodon.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index b3946f8..0103615 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -1,7 +1,5 @@ -(load-file "mastodon-auth.el") -(load-file "mastodon-http.el") - -(defvar mastodon--api-version "v1") +(defgroup mastodon nil + "Interface with Mastodon.") (defcustom mastodon-instance-url "https://mastodon.social" "Base URL for the Masto instance from which you toot." @@ -14,10 +12,13 @@ :group 'mastodon :type 'file) -(defvar mastodon--client-plist (mastodon--read-access-token-file) - "Stores CLIENT_ID, CLIENT_SECRET, and ACCESS_TOKEN. +(defvar mastodon--api-version "v1") -Reads values from `mastodon-token-file' if they exist.") +;;;###autoload +(defun mastodon () + (interactive) + (load-file "mastodon-http.el") + (load-file "mastodon-auth.el") + (load-file "mastodon-toot.el")) -(defvar mastodon--token (mastodon--read-or-get-access-token) - "API token for Mastodon.") +(provide 'mastodon) -- cgit v1.2.3