Order of pins in pinning implementation #16

Closed
opened 2023-11-06 23:28:03 +00:00 by cadence · 0 comments
Owner

On Discord

Pins have an order. When receiving the pins list, messages that were pinned more recently are at the start of the array.

On Matrix

The spec says that it is ordered however it doesn't say which way the order goes. Let's look through the sources to find out.

Sending:

Displaying:

In short, the order of the pinned array is reversed between Matrix and Discord for both sending and displaying.

## On Discord Pins have an order. When receiving the pins list, messages that were pinned more recently are at the start of the array. ## On Matrix The [spec](https://spec.matrix.org/latest/client-server-api/#mroompinned_events) says that it is ordered however it doesn't say which way the order goes. Let's look through the sources to find out. Sending: - [Element pushes newly added pins to the end of the array](https://github.com/matrix-org/matrix-react-sdk/blob/c344a378b4c6eccd24533012cece67511e3a2818/src/components/views/context_menus/MessageContextMenu.tsx#L271) - [FluffyChat pushes newly added pins to the end of the array](https://gitlab.com/famedly/fluffychat/-/blob/main/lib/pages/chat/chat.dart#L1093) - [nheko pushes newly added pins to the end of the array](https://github.com/Nheko-Reborn/nheko/blob/31aebb33ae95557b1b8c0e746d7bb7c7e1ed0592/src/timeline/TimelineModel.cpp#L1514) Displaying: - [Element displays them in reverse order, newest added first](https://github.com/matrix-org/matrix-react-sdk/blob/c344a378b4c6eccd24533012cece67511e3a2818/src/components/views/right_panel/PinnedMessagesCard.tsx#L206) - nheko displays them in forwards order, oldest added first, but [at least one user considers this a bug,](https://github.com/Nheko-Reborn/nheko/issues/1454) so this is an anti-example. In short, the order of the pinned array is reversed between Matrix and Discord for both sending and displaying.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 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: cadence/out-of-your-element#16
No description provided.