Commit Graph

416 Commits

Author SHA1 Message Date
Christian Muehlhaeuser
75578dd249 Update search to use v2 API endpoint
v1 has been disabled on most instances by now.
The change is minor: hash-tags are now reported as proper structs
instead of a simple string-array.
2020-03-02 11:37:25 +09:00
hiromi-mi
021f5d0019 fix CI for DeleteConversation 2020-02-25 22:09:24 +09:00
hiromi-mi
fd6533a508 Support conversations API
Support these APIs added in Mastodon 2.6.0.
- GET /api/v1/conversations
- DELETE /api/v1/conversations/:id
- POST /api/v1/conversations/:id/read
2020-02-25 22:09:24 +09:00
mattn
151613575d
Delete renovate.json 2020-01-28 19:41:13 +09:00
Renovate Bot
845b4bd395 Update golang.org/x/net commit hash to 6afb519 2020-01-16 22:12:54 +09:00
Renovate Bot
822b3dfd49 Update module mattn/go-tty to v0.0.3 2020-01-09 19:31:20 +09:00
Renovate Bot
1c963e9982 Update module gorilla/websocket to v1.4.1 2020-01-09 19:30:09 +09:00
Renovate Bot
edf591bde6 Update golang.org/x/net commit hash to c0dbc17 2020-01-09 18:56:36 +09:00
Renovate Bot
a4693067ab Update module fatih/color to v1.9.0 2020-01-09 18:54:25 +09:00
Renovate Bot
4275f0739f Add renovate.json 2020-01-09 18:51:47 +09:00
buckket
e43f2060a8 Modify test fixture to increse test coverage 2019-09-30 17:19:22 +09:00
buckket
2abdb8e37c Add support for /api/v1/push/subscription 2019-09-30 17:19:22 +09:00
Christian Muehlhaeuser
25da74b864 Fix follower pagination in cmd/mstdn
Make sure to reset Pagination's MinID on every iteration, as
discussed in #99.
2019-09-30 17:18:07 +09:00
Ben Lubar
c9e2d23df3 Make ScheduledAt a pointer. 2019-09-30 17:17:15 +09:00
Ben Lubar
977e6c550e Add support for creating scheduled posts 2019-09-30 17:17:15 +09:00
Ben Lubar
934e685e7a Add convenience constants for post visibilities 2019-09-30 17:17:15 +09:00
Yasuhiro Matsumoto
e24991527b Fix test 2019-09-30 17:15:56 +09:00
Yasuhiro Matsumoto
80c1d52a0d Fix tests 2019-09-30 17:15:56 +09:00
Yasuhiro Matsumoto
ef1332c96b Fix contact_account 2019-09-30 17:15:56 +09:00
Christian Muehlhaeuser
1b7f743892 Fix ineffectual assignments
- Don't assign variables we don't end up using
- Added missing error check in test
2019-09-30 17:14:20 +09:00
Christian Muehlhaeuser
1ccf66b8b4 Fix code formatting
Used goimports to fix code formatting.
2019-09-30 17:13:43 +09:00
Christian Muehlhaeuser
20bc690d8d Simplify code
- Removed redundant returns
- Implicitly declare httptest.Server
2019-09-30 17:13:12 +09:00
Christian Muehlhaeuser
24cdbe8c3d Unlambda textContent call
textContent already has the right function signature, no need to wrap it.
2019-09-30 17:12:31 +09:00
dtluna
34e64bb423 Make Client.Config public 2019-08-22 14:21:32 +09:00
mattn
050f1a0a87
Create FUNDING.yml 2019-08-14 15:00:40 +09:00
Christian Muehlhaeuser
8a48862adc Use a slightly more aggressive backoff approach
Doubling the backoff every iteration turned out to be a bit
too relaxed for the common situations where you run into API
throttling. This change gives the API enough room to breathe,
but re-tries requests just a little more often.
2019-08-08 16:47:43 +09:00
Yasuhiro Matsumoto
26fcedc8aa Update badge 2019-06-22 02:17:37 +09:00
Yasuhiro Matsumoto
536597515d Temporary disable test with -race 2019-06-22 02:17:37 +09:00
Yasuhiro Matsumoto
8826198705 Only tip 2019-06-22 02:17:37 +09:00
Yasuhiro Matsumoto
23fc4c7953 Switch to codecov 2019-06-22 02:17:37 +09:00
Yasuhiro Matsumoto
559ed99cdf Add direct
Closes #102
2019-06-22 01:52:45 +09:00
Yasuhiro Matsumoto
3268207afe Set User-Agent 2019-06-22 01:32:52 +09:00
buckket
8f6192e26b Add /api/v1/notifications/dismiss 2019-05-17 10:56:15 +09:00
Christian Muehlhaeuser
c09198f7c9 Fixed pagination parsing for non-numeric IDs
Mastodon API's pagination IDs are not guaranteed to be in a numeric format.
This happens to be the case for the tootsuite implementation, but others
use UUIDs or flake IDs for pagination.

This also simplifies the code a bit and luckily shouldn't break backwards
compatibility since they're already of type ID in the Pagination struct.
2019-05-17 10:55:38 +09:00
178inaba
f51571807d Add go.mod 2019-05-14 14:57:23 +09:00
buckket
e71411ef96 All parameters are now of pointer type and thus can be nil 2019-05-14 14:53:54 +09:00
buckket
636b33ad1c Renamed Source to AccountSource 2019-05-14 14:53:54 +09:00
buckket
68ca31fccd Add support for Field, Source and Locked parameters to AccountUpdate() 2019-05-14 14:53:54 +09:00
Christian Muehlhaeuser
bb2662b33c Handle HTTP 429 responses with a request backoff approach
Since it's difficult to wrap all possible go-mastodon API calls in a backoff
algorithm outside of the package itself, I decided to implement a simple
version of it in go-mastodon's doAPI itself.

This works nicely, but could be improved in two ways still:

- Abort sleeping when context gets cancelled
- Make backoff optional / configurable

Personally, I still think this is a good start and probably fits most of
go-mastodon's use-cases. It certainly beats string-grepping for status code
"429" in clients.
2019-05-14 14:52:36 +09:00
Christian Muehlhaeuser
e725c81450 Added tests for list API calls 2019-05-12 23:58:10 +09:00
Ben Lubar
9427a55316 Add list timeline support. 2019-05-12 23:58:10 +09:00
Ben Lubar
3e2bdc63c7 Add streaming list support. 2019-05-12 23:58:10 +09:00
Ben Lubar
6f05c48bf6 Add list API support. 2019-05-12 23:58:10 +09:00
Brian C. Lindner
e804ee7eb2 Added UploadMediaFromReader 2019-03-11 14:18:07 +09:00
178inaba
efa05aa949 Fix TestNewPagination
Add min_id error pattern.
2019-02-15 10:03:18 +09:00
178inaba
460b971f54 Fix TestPaginationSetValues 2019-02-15 10:03:18 +09:00
178inaba
1fcdf9f501 Fix TestPaginationSetValues 2019-02-15 10:03:18 +09:00
178inaba
5fd7d16157 Fix followers command
Set empty for SinceID.
2019-02-15 10:03:18 +09:00
178inaba
b8bb5ae68c Add MinID to Pagination 2019-02-15 10:03:18 +09:00
Jessica Paczuski
6bf95fc751 Rename Size -> AttachmentSize 2019-02-06 19:06:00 +09:00