3
I am implementing a messaging system and need to make a way to remove messages from one caller without affecting the other.
So-and-so and Sicrano exchange messages:
- At a certain point, Fulano removes the conversation, but Sicrano continues with the full conversation history.
- When Fulano and Sicrano resume the dialogue, Fulano will only see the new messages and Sicrano continues with the messages from the beginning.
- Naturally, messages can only be removed when both remove the conversation, and when a new message is exchanged there will be no old messages.
Perhaps by setting an individual flag with the timestamp of the last removal of the conversation, so only those messages that were earlier than the date were deleted by both Fulano and Sicrano would be listed. That way it would be easier to 'hide' in the message box those that were removed by an interlocutor, but it would be more complicated to combine the point where both parties deleted the messages to actually give a DELETE.
I followed the same reasoning, I would make a
selectlimiting the messages by timestamp, and thedeletewould be via cron.– Papa Charlie
In the case of
selectyou will execute according to thetimestampat the time of thedeleteis always the smallest.– Maicon Carraro