Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Adds a pinned message to the rooms table #21

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

darcys22
Copy link
Collaborator

The rooms table will keep track of a single i64 to track a pinned
message for that room. Three associated endpoints have been added to
keep track of this pinned message.

GET pinned_message
Will return the pinned_message_id which should map to the pinned message
to display

POST pin_message
Takes a single i64 corresponding to a message id and updates the room
table to keep record of this message id as a pinned message

DELETE pinned_message
Resets the pinned message in the rooms table to 0 for no pinned message

All endpoints are under authorisation and POSTING and DELETING require
moderator status.

@darcys22
Copy link
Collaborator Author

darcys22 commented Sep 10, 2021

TODO

  • Migration code

To address migration code in a separate PR after #24 and other changes for the next release

src/handlers.rs Outdated Show resolved Hide resolved
src/handlers.rs Outdated Show resolved Hide resolved
src/rpc.rs Show resolved Hide resolved
src/handlers.rs Outdated Show resolved Hide resolved
src/handlers.rs Outdated Show resolved Hide resolved
src/handlers.rs Outdated Show resolved Hide resolved
src/models.rs Outdated Show resolved Hide resolved
src/rpc.rs Show resolved Hide resolved
src/storage.rs Outdated Show resolved Hide resolved
@darcys22
Copy link
Collaborator Author

Waiting for #24, which will handle the DB changes.

@darcys22 darcys22 changed the base branch from stable to dev October 15, 2021 05:52
src/handlers.rs Outdated Show resolved Hide resolved
src/handlers.rs Outdated Show resolved Hide resolved
src/handlers.rs Outdated Show resolved Hide resolved
src/tests.rs Outdated Show resolved Hide resolved
The pinned messages table will keep track of a pinned messages
for rooms so that clients can highlight certain message for that room.
Three associated endpoints have been added to keep track of these
pinned messages. Currently the endpoints only keep track of a single
message per room however the database structure will allow for multiple
in future if needed.

GET pinned_message
Will return the pinned_message struct which contains the message id
for the pinned message.

POST pin_message
Takes a single i64 corresponding to a message id and updates the
pinned_message table to keep record of this message.

DELETE pinned_message
Deletes the pinned message for the specified room table to null for no pinned message

All endpoints are under authorisation and POSTING and DELETING require
moderator status.
@darcys22 darcys22 force-pushed the pinned-messages branch 2 times, most recently from 6f37486 to b3528c2 Compare October 19, 2021 02:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants