Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

skype main.db - difference between Chats and Conversations

I've been dissecting Skype database main.db for a couple of days, and this is something which I haven't yet figured out. Naturally, this question will be very specifically for Skype main.db structure.(disclaimer)

It seems that all the necessary information that I need are in tables Conversations, Messages, Participants.

Message table contains actual log that has been said, the recipient(s), timestamp, and the convo_id foreign key(although not enforced) to connect to a Conversation which the message belongs to.

Conversation exists to hold the aggregates of Message and the Contacts that participate in.

Participants table works to a many-to-many connector table between the Conversations table and Contacts table.

What gets me are Chats and Chatmembers table. Chatmembers works to Chats what Participants table works to Conversations table; connecting Contacts and the conversations-or 'chats'.

What's in Chats is similar to Conversations except that it does not have any aggregate to Message table. It is impossible to map from Messages table to Chats table to which the message log(row of Messages table) belongs.

Chats and Conversations share a foreign key, Conversations table has a column named chat_dbid which joins to the Chats table. But there are rows in Conversations table which have a null chat_dbid field, and not all rows in Chats have id field which corresponds to chat_dbid field in Chats table.

The Chats table is still being updated and I recognize some of the chats-or conversations- I've had recently based on the timestamp and the members in it.

Does anyone know exactly what Chats table does? Or rather, what's the difference and justification for Chats table and Conversations table?

When I looked frantically for this I could find only one like that talked about main.db structure, and it wasn't very helpful.

According to the link Chats

Provides the chats in which the user participated.

and Conversations

Provides a list of the conversations in which the user participated.

What's their terminology about Chats and Conversations? How are they different?

It's been driving me crazy.

like image 636
Jace Kim Avatar asked Jun 02 '13 19:06

Jace Kim


1 Answers

Yesterday I was also going through main.db table in skype. Below are my findings.

Conversations table uniquely identifies conversation with a particular contact(or a group contact you have created). Conversation entails all communication: chat messages, voice message, file transfers, calls that you do with a particular contact. Most of the tables have references to the entry in this table. Messages table has convo__id, Chats table has conv_dbid, Transfers has convo_id and likewise.

Messages table: messages entry are not always chats. If an entry is chat then its chatname field is populated. It seems that chats and messages has one to many relations. chat is a collection of messages maintained per some identifier(most probably day not sure.). "type=61" seems to be normal message: message typed by user. Other types seem to be auto generated messages for eg. msg you get if a call is disconnected.

Hope this helps.

like image 116
Sameer Avatar answered Oct 18 '22 16:10

Sameer