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

[chat] As an admin, I want to be able to convert a chat message to a question (and vice versa) #1642

Open
yarikoptic opened this issue Jun 23, 2021 · 1 comment
Labels
🔰 good first issue This issue is good for newcomers, fairly small, and not require too much familiarity with the code 📢 help wanted Looking for somewhere to jump in? This might be a good place to look! 💪 enhancement Enhancements/improvements to existing functionality

Comments

@yarikoptic
Copy link
Contributor

didn't look inside but visually it is just style/color (class?) change. Naive attendees post questions as regular messages, being able to convert to a question (or back) would be a nice feature.

@0xdevalias
Copy link
Contributor

0xdevalias commented Jun 24, 2021

Sounds like a reasonable feature/thing to be able to support :)


It seems isQuestion is defined on BaseChatMessage:

ChatMessageBox receives isQuestion which is used in sendMessageToChat as sendMessage({ message, isQuestion });

sendMessage is passed into ChatMessageBox as a prop from Chatbox, which is provided to it via it's own props, which come from either VenueChat / RecipientChat (though only VenueChat supports questions really..)

VenueChat gets sendMessage from useVenueChat

This ends up calling buildMessage from utils/chat.ts, then calls sendVenueMessage, defined in src/api/chat.ts:

This then writes to the following locations in the firestore database:

  • sendVenueMessage: /venues/:venueId/chats/:messageId

You can see the rules that relate to whether this can be edited/etc from the frontend in firestore.rules

Essentially it can be 'updated' by admin/owners, when isUpdateRestrictedToField(request, 'deleted') is true.

isUpdateRestrictedToField is defined in the same firestore.rules file:

Currently it looks like it only supports one field being checked, but it would be a fairly easy change to support different checks as needed. Reference docs for the firebase rules SDK are here:

Then obviously appropriate UI/etc things would need to be done to support this being done in a clean/sparkly way.

Hope this helps! :)

@0xdevalias 0xdevalias added 💪 enhancement Enhancements/improvements to existing functionality 🔰 good first issue This issue is good for newcomers, fairly small, and not require too much familiarity with the code 📢 help wanted Looking for somewhere to jump in? This might be a good place to look! labels Jun 24, 2021
@0xdevalias 0xdevalias changed the title Feature request: chat - be able to convert a chat message to a question [chat] As an admin, I want to be able to convert a chat message to a question (and vice versa) Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔰 good first issue This issue is good for newcomers, fairly small, and not require too much familiarity with the code 📢 help wanted Looking for somewhere to jump in? This might be a good place to look! 💪 enhancement Enhancements/improvements to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants