[eluser]Mischievous[/eluser]
I've actually just got done building a replicate of facebook messaging with CI. And actually if you think about it, facebook messaging is just a conversation set between two users. My system needed to be a little bit more complex for specific project reasons. However, I have basically 3 tables:
messages, message_sets, message_statuses
Messages has: message_id, message_reply_to_id, message_set_id, sender_id, recipient_id, subject, body, time, last_update, recipient_status_id, sender_status_id.
Message_sets has: message_set_id, time, last_update, sender_user_id, recipient_user_id, marked_spam, sender_deleted, recipient_deleted
Message_statuses has: message_status_id, status
Then just setup a model that would get Message Sets grouped set id and entire message convo and the basic send etc. functions needed.
Whole thing was actually fairly simple.