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

Add Direct Messages #3093

Merged
merged 41 commits into from
Nov 21, 2023
Merged

Add Direct Messages #3093

merged 41 commits into from
Nov 21, 2023

Conversation

jmsmkn
Copy link
Member

@jmsmkn jmsmkn commented Nov 19, 2023

This PR adds the Direct Messages application. It introduces three main new models:

  • Conversation: Many users are participants of one conversation. Many permissions are added to each conversation - view, create_conversation_direct_message, mark_conversation_read, mark_conversation_message_as_spam.
  • DirectMessage: Has a foreign key to a conversation, sender and which users have not read this message. The sender can delete the message and the conversation participants can mark the message as spam. If a direct message is created the other participants in the group have the message marked as unread. If a message is deleted or marked as spam then all of the unread markers are deleted.
  • Mute: tracks which users have muted which other users. If a direct message is created and the receiver has muted the sender the message is not marked as unread by the receiver.

The views use HTMX. As a conversation is loaded all of the messages are marked as read as a callback. For now only challenge admins can message their participants.

See https://github.com/DIAGNijmegen/rse-roadmap/issues/255

@jmsmkn jmsmkn marked this pull request as ready for review November 19, 2023 14:22
amickan
amickan previously approved these changes Nov 20, 2023
Copy link
Contributor

@amickan amickan left a comment

Choose a reason for hiding this comment

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

Impressive! I worked my way through the code and tried to break it, but it all appears to be working as intended :-) I think some more tests would be good though.

I really like the look and feel of the UI for the messages as well.

@jmsmkn jmsmkn merged commit 175a3b0 into main Nov 21, 2023
8 checks passed
@jmsmkn jmsmkn deleted the direct_messages branch November 21, 2023 16:04
HarmvZ added a commit to DIAGNijmegen/rse-gcapi that referenced this pull request Jul 26, 2024
Faker was added on gc in comic/grand-challenge.org#3093, but it was not added to poetry and it is not available in the production container.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants