Mastodon API: Status.pinned attribute not set #160

Open
opened 2023-08-29 19:23:15 +02:00 by VyrCossont · 1 comment
Contributor

According to the Mastodon docs, Status.pinned should be true if the post is pinned by the current user, false if the post is not pinned but could be, and absent on all other posts (such as DMs, or posts created by another user). It looks like this is not implemented, and Misskey.noteWithDetails in packages/megalodon/src/misskey.ts should be extended to include the pin status: true the note is pinned (if it's in the Misskey user's pinnedNoteIds or pinnedNotes lists), false if the note isn't pinned but could be, or null if the post is from a different user or otherwise not eligible for pinning.

Impact: Mastodon API clients can't pin or unpin posts (since they rely on the presence and non-null-ness of pinned to identify pinned or eligible posts).

According to the Mastodon docs, [`Status.pinned`](https://docs.joinmastodon.org/entities/Status/#pinned) should be `true` if the post is pinned by the current user, `false` if the post is not pinned but could be, and absent on all other posts (such as DMs, or posts created by another user). It looks like this is not implemented, and `Misskey.noteWithDetails` in `packages/megalodon/src/misskey.ts` should be extended to include the pin status: `true` the note is pinned (if it's in the Misskey user's `pinnedNoteIds` or `pinnedNotes` lists), `false` if the note isn't pinned but could be, or `null` if the post is from a different user or otherwise not eligible for pinning. Impact: Mastodon API clients can't pin or unpin posts (since they rely on the presence and non-null-ness of `pinned` to identify pinned or eligible posts).
jeder added the
bug
label 2023-08-29 20:23:47 +02:00
zotan self-assigned this 2023-08-30 16:44:05 +02:00
Owner

This will require a bit more work, I think the best way to implement this is to add a pinned attribute to the /notes/state and then aggregate the call with the isBookmarked function for the best performance.

This will require a bit more work, I think the best way to implement this is to add a `pinned` attribute to the `/notes/state` and then aggregate the call with the isBookmarked function for the best performance.
zotan referenced this issue from a commit 2023-11-10 04:19:13 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: iceshrimp/iceshrimp#160
No description provided.