papercups-io / papercups

Open-source live customer chat
https://app.papercups.io/demo
MIT License
5.76k stars 525 forks source link

Crafted messages on the client can be made to look like Agent's #824

Open lucasavila00 opened 3 years ago

lucasavila00 commented 3 years ago

Describe the bug There is one changeset function to create messages, used by both conversation and notification channels.

It should have 2, one for each case. In the client create-message-changeset-function, it should cast and require customer id, and refuse user id. In the agent side, it should cast and require user_id and refuse customer_id.

As it is, a crafted message sent from the client is written and propagated as if it were from the Agent.