Shinmera / tooter

A Common Lisp client library for Mastodon instances.
https://shinmera.github.io/tooter
zlib License
44 stars 6 forks source link

Maybe duplicated method `follows' and `timeline' specialized on string #10

Closed cage2 closed 4 years ago

cage2 commented 4 years ago

Hi shinmera!

I think the method follows is specialized on string (second parameter) twice in queries.lisp.

https://github.com/Shinmera/tooter/blob/master/queries.lisp#L210 https://github.com/Shinmera/tooter/blob/master/queries.lisp#L86

and to me seems that the first is wrong, if both are true i could issue a PR removing the first method if this is the only change needed. I did not issued already a PR because i am not 100% sure removing the method fix this issue (if this issue exists at all).

Bye! C.

Shinmera commented 4 years ago

They're two different methods that now collide since IDs are strings instead of integers. The one at L210 is for following accounts on a remote instance, whereas the one at L86 is for following accounts on the same instance. They need to be merged, but the method now needs to distinguish the cases by peeking at the ID and seeing if it's a remote account URI or not.

cage2 commented 4 years ago

Hi! So the problem is more complicated, but also more interesting! :)

I am not exactly sure that you need to to tell apart remote and local account if i am reading the documentation correctly (and usually i don't! :D)

https://docs.joinmastodon.org/methods/accounts/

in POST /api/v1/accounts/:id/follow id is the account identifier in the database

Bye! C.

cage2 commented 4 years ago

Hi shinmera!

I think the same problem arose with timeline

https://github.com/Shinmera/tooter/blob/master/queries.lisp#L577

I think in this case could be useful just to give a function a different name like timeline-tags or similar, what do you think about that?

Bye! C.

Shinmera commented 4 years ago

I wonder why they even offer two endpoints when you can do everything with one. Oh well.

cage2 commented 4 years ago

who knows! :-)