aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
Commit message (Collapse)AuthorAgeFilesLines
* boilerplate maintainer contactmousebot2021-12-171-0/+1
|
* depend on emacs 27.1, flychecks, docstrings, etc.mousebot2021-12-171-1/+1
| | | | strictly, the 27.1 dependency is only for proper-list-p in -http.el.
* bump version, change homepage link, readmemousebot2021-12-171-2/+2
|
* a first hack to make media uploads immediate and async.mousebot2021-12-151-1/+1
| | | | | | | | | this commit moves the call to -upload-attached-media into -attach-media. upload-attached-media now uploads a single item only, whichever file has just been selected at the prompt. but we still use the list of attached-media to handle preview displays.
* Do a bit if `if` and `progn` sanitizing.Holger Dürer2021-11-061-13/+11
| | | | | | | - 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`.
* Convert most uses of `(cdr (assoc <some-symbol> <a-list>))` to `(alist-get ↵Holger Dürer2021-11-061-5/+5
| | | | | | | <some-symbol> <a-list>)` This is more readable and actually more efficient (maybe) since it uses `eq` rather than `equal` as a test.
* Clean up uses of `url-retrieve-synchronously`.Holger Dürer2021-11-061-28/+12
| | | | | | | | | | We recently introduced a new thin abstraction `mastodon-http--url-retrieve-synchronously` but did not make use of it everywhere. This also moves its definition to the top above its first use. This also removes some dead, commented-out code.
* Reformat all code.Holger Dürer2021-11-061-44/+43
| | | | | | | | | | | Basically, in Emacs for each file: select all text and `indent-region`. - This also removes one redundant comment, and - fixes an error with json decoding where the `json-read-from-string` was actually not within the intended `unless` clause (which explains the warning about "result of (string-equal "" json-string) will be ignored" which I never understood.
* Fix tests.Holger Dürer2021-11-011-4/+12
| | | | | | | | | | | | These needed a bit of tender love and care to get back into passing state. - Move the auth tests to the `test` directory. No idea what it was doing in `lisp`. - Image tests are mostly broken because with later Emacsen we no longer need the `imagemagic` option on create-image. - Some method signatures have changed and mocking calls needed to follow suit.
* Fix compilation warnings.Holger Dürer2021-11-011-1/+1
| | | | | | | | | | | | 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.
* merge upload-media-attachments functionality into toot-send.mousebot2021-10-291-3/+4
| | | | | | | | | | | | | | | | | | | | this obviates the need for the user to upload files before posting their toot. - this commit makes http--post-media-attachment synchronous, so that toot-send has to wait for it. - in toot-send: if mastodon-toot--media-attachements is non-nil, the files it contains are uploaded synchronously, and their returned ids are added to toot-media-attachment-ids, which are parsed as args for the POST request to be attached to the toot. - then we send toot as usual. - clear-all-attachments also clears mastodon-toot--media-attachment-ids just in case. - we have no more need of media-attachments-filenames, as media-attachments is now a list and not a boolean value.
* hopefully improve attachment upload error handlingmousebot2021-10-291-9/+15
|
* move read-file-as-stringmousebot2021-10-231-6/+6
|
* remove wrongly set http--timeoutmousebot2021-10-231-2/+2
| | | | | | - http--timeout was given as an 4th arg to url-retrieve, which has nothing to do with timeouts, but is whether to be silent or not. - timeout arg only exists for url-retrieve-synchronously
* flycheck, autoloads, docstringsmousebot2021-10-221-2/+3
|
* docstring typomousebot2021-10-221-1/+1
|
* restore hdurer's http--read-file-as-stringmousebot2021-10-211-0/+6
|
* improvements to toot mentions completionmousebot2021-10-211-6/+8
| | | | | | | | | - customize option for completion off, following-only, or all. - 'following=true' is forwarded to http--get-search accordingly. - use company-grab-symbol-cons + regex, prepend "@" to it - also prepend '@' to the list in get-user-info-no-url - this makes company display user handles prepended with '@', and to match and - enter a handle without duplicating the '@'
* remove empty lines from docstringsmousebot2021-10-211-6/+0
|
* set a larger mastodon-http--timeout.mousebot2021-10-051-1/+1
| | | | loading profiles would often not make in 5 seconds on a slower connection
* flycheck: docstrings, autoloads, declarationsmousebot2021-10-021-1/+5
|
* repair somewhat the media-upload functions and error handlingmousebot2021-10-021-13/+13
|
* package-lint: bump to emacs 26.1, disable stream keybindingsmousebot2021-09-221-1/+1
|
* mastodon-http--triage - messages errors rather than response buffermousebot2021-08-091-2/+15
|
* typo in async http-layer, unless in http process-json, typo in readmmousebot2021-06-211-3/+2
|
* attempt to handle response errors in mastodon-http--process-jsonmousebot2021-06-071-1/+3
|
* mastodon-http--get-async, only process json when status is returnedmousebot2021-06-071-1/+2
| | | | (hopefully)
* implement updating user profile notemousebot2021-06-051-1/+24
| | | | | uses a tiny minor mode 'profile-update', with bindings. U is a general binding for it.
* bump masto version, bump emacs version to 25.1, dependency in readmemousebot2021-05-311-2/+2
|
* http: docstrings and move delete funmousebot2021-05-301-11/+11
|
* add request and seq as dependencies, flycheck cleanups, andmousebot2021-05-271-4/+39
| | | | move http search funs into http.el
* flychecks and autoloadsmousebot2021-05-261-3/+4
|
* clean up media upload in http.elmousebot2021-05-261-1/+1
|
* typos in tl and http error responses in http.el for attachmentsmousebot2021-05-261-2/+6
|
* implement uploading and posting of media attachments.mousebot2021-05-241-0/+42
| | | | | | uses request library and requires curl backend. supports multiple files upload and marking media as sensitive.
* clean-up edits after flycheck/bytecompile.mousebot2021-05-161-2/+3
|
* display "follows you" and "followed by you" on user profilesmousebot2021-05-141-3/+1
|
* Guard against the old version of Emacs which mastodon.el supports.Ian Eure2021-05-091-3/+7
|
* SWAG at moving to an async network model.Ian Eure2021-05-091-12/+51
|
* Set a HTTP timeout.mousebot2021-05-091-2/+5
| | | | This prevents mastodon.el from locking Emacs and spinning forever.
* docstringmousebot2021-05-061-1/+1
|
* add delete toot functionmousebot2021-05-061-0/+11
|
* Update copyright and bump versionJohnson Denen2019-03-041-2/+2
|
* Bump to version 0.8.0Johnson Denen2018-08-101-1/+1
|
* Retoot add accts closes #155Alexander Griffith2018-03-051-1/+1
| | | | | | | | | | | | | When responding to toots the full acct for both local and federated accounts are now added to the new toot buffer. Changes - Added a function in mastodon.el to return the current user acct - Added mastodon-toot--process-local, which takes an acct and appends the current server if it is local returns an empty string if the acct matches the current user and does only adds a prefix @ if the acct is federated - mastodon-toot--mentions will return a formatted string of mentions or an empty string - adds tests for mastodon-toot--mentions - adds a missing , in mastodon-http--post - `mastodon-toot--reply` now passes `mastodon-toot` a toot-id rather than the whole json - 'mastodon-toot--reply-to-id is now a local var in a new toot
* Bump to 0.7.2 and shorten long code lines (#172)Alexander Griffith2018-03-051-1/+1
| | | | | | * Bump version numbers to 0.7.2 * Adjusted functions to bring line length below 90.
* Keep track of to which instance secrets in plstore belong.Holger Dürer2018-03-021-5/+6
| | | | | | | | | | | While testing out issue 149 (https://github.com/jdenen/mastodon.el/issues/149) I had problems due to stale client information being cached. With this change we store various pieces of information (the client information in the plstore and the auth tokens) in alists keyed by the instance url (and the plstore key contains the instance url as well to allow us to store data per instance).
* Closes #152 and extends the fix for #150 as well as a host of bug fixesAlexander Griffith2018-02-281-0/+1
| | | | | | | | | | | | | | | | | | We now kill the http get request buffer once JSON has been extracted. mastodon-tl--as-string was implemented and replaced any occurrence of number-to-string or int-to-string Added variable mastodon-tl--display-media-p. By default it is 't but can be made a local buffer variable and set to nil. When nil rather than displaying the media it just provides a link Media::<link> Fixed checking for faves and boosts, they should now render properly. The return from json-read-from-string for nil is :json-false which evaluates to 't in elisp. Fixed the format string that gets printed when faving and boosting Fixed mastodon-tl--thread updating and requesting and changed its behaviour such that it tries to open the original toot thread rather than the boosted thread. Added tests for both the new mastodon-tl--as-string function and the mastodon-tl--toot-id utility. enter mastodon mode before defining local buffer variable mastodon-tl--buffer-spec. This fixes some oddities with the local buffer variable.
* Bump version to 0.7.1Johnson Denen2017-06-191-1/+1
|
* Bump to v0.7.0Johnson Denen2017-05-181-1/+1
|