Skip to content

add pin message api #7817

Description

@r10s
  • add an api to pin/unpin a given message.

    • api takes at least the msg_id as parameter.
    • it is allowed to pin self or others messages, in one-to-one chats, in groups, in saved-messages.
    • send info message, "USER pinned a message", its parent is the rfc724_mid to be pinned. same for unpinning, however, that info message is not visible
    • receiving the info message fires an event or all members, that then know that pinning state has changed
  • add an api to list pinned messages, so to get all pinned msg_id from a given chat_id. this api is used to show the pinned messages atop of the list

  • add pinned/unpinned state (boolean) to message object; this is used to show a "pin needle" beside pinned messages.

we do not take care about resending pinned messages if someone join a group; this may or may not come later, maybe #7766 is good enough or even better privacy wise. for channels, we can resend pinned messages in addition to resending last 10 messages without many issues.
info messages themselves must not be be pinnable atm (as there do not have a shared rfc724_mid).

to not add complexity and to not have additional database calls or joins on getting messages, easiest way might be to have a "pinned" column in the msgs table.

once a PR is started, UI should be start implementing, one of android/iOS/desktop.

recent discussion in the forum https://support.delta.chat/t/2176/5

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions