contact_id is the user on the other end of the message, either sender or receiver. The sent boolean tells you which one it is. This is a simple way to keep a separate copy for each user, while making it clear which role the user has in the message.