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
select
limiting the messages by timestamp, and thedelete
would be via cron.– Papa Charlie
In the case of
select
you will execute according to thetimestamp
at the time of thedelete
is always the smallest.– Maicon Carraro