Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-1801 (I): SQL additions to support in-site social aspects #2108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reosarevok
Copy link
Member

@reosarevok reosarevok commented May 18, 2021

Implement MBS-1801

This adds five tables to their own messaging namespace.

message is for user-to-user messages - as such, it has a sender and a receiver, plus a title and content. It also has an optional
parent column which will store the previous message when there is a message thread.

hidden_message allows for either the sender or receiver (or both) to "remove" a message from their messaging list. This is less complex than removing the message outright (on demand from which of the users?) and makes sure that the content is available to an admin to verify abuse without the user needing to keep the abusive message in their inbox.

notification is for system notifications. These could be implemented as messages from ModBot, but having them in a separate table seems simpler since we are likely to want to display them separately. It also makes it easier to deal with them separately if we decide to, for example, make notifications be removed some time after being read.
In preparation for such a possibility, read is a timestamp for notification, but just a boolean for message where we expect to only remove (hide) messages on request by the sender or receiver.

edit_thanks and edit_note_thanks allow editors to thank others for their edits and edit notes, respectively. The thanking itself
is stored in these tables, and I expect it should be possible for a user to check all their sent or received thanks later on.
The user being thanked should also be notified, so on a new thanking a notification should be inserted in the notification table. Whether this will happen via a trigger or through code can be decided later.

@reosarevok reosarevok added the New feature Non urgent new stuff label May 18, 2021
@reosarevok reosarevok requested review from mwiencek and yvanzo May 18, 2021 21:00
Copy link
Member

@mwiencek mwiencek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good overall. I think the indexes are fine, but we can always tweak them later if not.

This adds five tables to their own messaging namespace.
message is for user-to-user messages - as such, it has a sender
and a receiver, plus a title and content. It also has an optional
parent column which will store the previous message when there
is a message thread.

hidden_message allows for either the sender or receiver (or both)
to "remove" a message from their messaging list. This is less complex
than removing the message outright (on demand from which of the users?)
and makes sure that the content is available to an admin to verify abuse
without the user needing to keep the abusive message in their inbox.

notification is for system notifications. These could be implemented
as messages from ModBot, but having them in a separate table
seems simpler since we are likely to want to display them separately.
It also makes it easier to deal with them separately if we decide to,
for example, make notifications be removed some time after being read.
In preparation for such a possibility, "read" is a timestamp
for notification, but just a boolean for message where we expect
to only remove (hide) messages on request by the sender or receiver.

edit_thanks and edit_note_thanks allow editors to thank others
for their edits and edit notes, respectively. The thanking itself
is stored in these tables, and I expect it should be possible for a user
to check all their sent or received thanks later on.
The user being thanked should also be notified, so on a new thanking
a notification should be inserted in the notification table.
Whether this will happen via a trigger or through code
can be decided later.
@reosarevok reosarevok marked this pull request as ready for review May 20, 2021 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature Non urgent new stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants