If one were to copy twitter's DM feature, how would you go about designing the schema for it? I'm able to send and reply to messages, but my issue is how do I keep track of the sent messages? If Bob sends Amy a message, Amy will see Bob's message. Bob also has a copy of his message located in his "sent folder."
Right now, each message has a "recipient" and "sender." At first thought, I thought I it since I could just query to see who the sender is, thus displaying the message in the user's "Sent" tab. However, Amy might want to delete the message, then what? I don't want to get rid of the message since Bob may still want it in his sent archive for whatever reason.
The only other option I could think of is to save the message twice, which is stupid and could get out of hand.