The way Chats are stored in Pleroma’s DB is kinda interesting. Each message has an entry in the Objects table, as well as two “message reference” entries, one entry for each user viewing the message. This allows each user to have their own view of the chat. This way each message can be “read” or “unread” for that user, and the user can even delete the other user’s messages… but it only disappears for you.