| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This allows user to customize how buffers get shown using
'display-buffer-alist'.
Also refactors mastodon-auth--show-notice.
|
|
|
|
|
|
|
|
|
| |
If a user re-loads their mastodon.el configuration within an emacs
session after using mastodon.el, the variable `mastodon-instance-url'
may no longer be considered `eq' to the original value, even if they
are the same string.
To avoid this problem, compare using `equal'.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* lisp/mastodon-toot.el (mastodon-toot--set-toot-language):
* lisp/mastodon-tl.el (mastodon-tl--read-rules-ids):
* lisp/mastodon-profile.el (mastodon-profile--remove-from-followers-list):
* lisp/mastodon-auth.el (mastodon-auth--access-token):
* lisp/mastodon-views.el (mastodon-views--add-account-to-list)
(mastodon-views--remove-account-from-list): Remove redundant optional
arg to `alist-get` (`equal` is already the default).
|
|
|
|
|
|
| |
mastodon-profile-credential-account
FIX #480.
|
| |
|
| |
|
| |
|
|
|
|
| |
main file is set in .dir-locals.el now
|
|
|
|
| |
sort autoloads in profile.el
|
| |
|
|
|
|
| |
This breaks if it contains any % characters.
|
| |
|
| |
|
| |
|
|\ |
|
| |\
| | |
| | |
| | |
| | |
| | | |
Red_Starfish/mastodon-up.el:login into develop
Reviewed-on: https://codeberg.org/martianh/mastodon.el/pulls/255
|
| | |
| | |
| | |
| | |
| | | |
The variable `mastodon-auth-source-file' serves no purpose so change it
from a defcustom to a defvar. Also update its docstring to document it.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Hold the explanation string in the variable
`mastodon-auth--user-unaware'. This explanation is provided to old
mastodon.el users who are not aware of the 2FA related changes.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Most old users of the mastodon.el wouldn't know about the introduction
of new variable `mastodon-active-user'[1]. Our goal is to make them
aware.
Set the default value of [1] to nil. This way we can know that the user
hasn't set [1] properly because user is unaware of it.
In the definition of `mastodon-auth--access-token', check [1]'s value
and if it's null, explain to the user about the new situation. Finally
signal the error "Variables not set properly".
We have considered the possibility of automating the process but since
the new login mechanism depends on setting [1] *in the init file*, the
only way to automate it would be to write to user's init file which we
consider to be very rude and shouldn't be done by this package.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of using the minibuffer prompt to present the explanation what
the user needs to do to get authorization code, use Emacs buffer and
Window. The minibuffer prompt should have 2-3 words.
This increases the readability of the explanation.
Of course delete explanation buffer and restore the window configuration
as it was after reading from minibuffer.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Change the name of the function `mastodon-auth--ask-authorization-code'
to `mastodon-auth--request-authorization-code'.
Suggested-by: Marty Hiatt <martianhiatus@riseup.net>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
mastodon.el currently follows the convention where all function names
should have two dashes (not one dash) in between function and namespace
names. Update all function names to follow this convention.
See issue #205 and pull request #255
|
| | |
| | |
| | |
| | |
| | | |
Update Copyright holder info for files that have undergone non trivial
changes.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Refactor `mastodon-auth--access-token' and
`mastodon-auth--handle-token-response' to work with the new
authentication mechanism.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Remove `mastodon-auth--generate-token-no-storing-credentials' and
'mastodon-auth--generate-token-and-store' as these two are no longer
needed.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Refactor `mastodon-auth--generate-token' to work with new user
authentication and token generation mechanism. This enables mastodon.el
to work with 2FA and also not to handle password directly.
In this implementation mastodon-auth--generate-token gets authorization
code from the user and sends post request to mastodon server. Ask for
authorization code from the user using two helper functions:
* mastodon-auth--ask-authorization-code: Explain to the user what the
user needs to do to get the authorization code. Store this explanation
message in variable `mastodon-auth--explanation'.
* mastodon-auth--get-browser-login-url: Return a appropriate query
string appended to url to the caller, which is needed by the user to
access the authorization code.
|
|\| | |
|
| |/ |
|
|\| |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
strictly, the 27.1 dependency is only for proper-list-p in -http.el.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
- A `progn` with a single form is redundant
- `when` doesn't need a `progn` body
- `if` has an implicit `progn` for the consequences
- I converted one cascade of `if`s into a `cond`.
|
| |
| |
| |
| |
| |
| |
| | |
<some-symbol> <a-list>)`
This is more readable and actually more efficient (maybe) since it
uses `eq` rather than `equal` as a test.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is mostly reflowing / reworkding docstrings to keep within 80
characters limit and adding autoloads.
There are two warning remaining that I don't understand:
- mastodon-async.el:359:16: Warning: reference to free variable
‘url-http-end-of-headers’
- mastodon-http.el:139:8: Warning: value returned from (string-equal json-string "") is unused
When adding autoloads this sorts them for better readability.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, `mastodon-auth--access-token` unconditionally returns the
value of the `:access_token` key from the response of
`(mastodon-auth--get-token)`. This causes problems when there was an
error getting the token, for example, if you enter the wrong
password. If a token couldn’t be retrieved, the JSON looks like:
(:error "invalid_grant"
:error_description "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.")
Since there is no `:access_token` key, `mastodon-auth--access-token`
returns `nil`, which results in a broken header in the next request:
Authorization: Bearer
Which causes the whole thing to freeze Emacs until you mash `C-g`.
This commit rewrites the function to handle that case; to explicitly
signal an error for *any* response that isn’t expected; to use
`if-let`, which allows the temporary `token` variable to be
eliminated; uses `pcase` to determine what kind of response was
received; and adds ERT tests for all these cases.
|