7

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.

4

2 回答 2

4

昨天我也在 Skype 中查看 main.db 表。以下是我的发现。

对话表唯一标识与特定联系人(或您创建的组联系人)的对话。对话涉及所有通信:聊天消息、语音消息、文件传输、与特定联系人进行的通话。大多数表都引用了该表中的条目。Messages 表有 convo__id,Chats 表有 conv_dbid,Transfers 有 convo_id 等等。

消息表:消息条目并不总是聊天。如果条目是聊天,则填充其聊天名称字段。聊天和消息似乎是一对多的关系。聊天是每个标识符维护的消息集合(很可能是不确定的一天。)。“type=61”似乎是正常消息:用户键入的消息。其他类型似乎是自动生成的消息,例如。如果通话断开,您会收到消息。

希望这可以帮助。

于 2013-07-18T05:42:30.600 回答
2

看起来聊天是多余的。作为事后的想法,消息被分组到聊天中,您可以在一个对话中包含多个聊天,然后在任何聊天之外有一些消息。分组规则不清楚,也许是时间。

分组是通过将chatname一堆消息的字段设置为相同的值来完成的。聊天名称看起来像#SenderId/$TargetId;ChatId#SenderId/ChatId用于群聊上的聊天。

ChatIds 似乎没有任何特定含义,并且在不同的 PC 上可能会有所不同。

并非每个 Chat 都会在 Chats 表中获得一个条目:SELECT DISTINCT(chatname) FROM Messages提供的条目比SELECT * FROM Chats. 并非所有内容都是chatname来自 Chats 的聊天名称。有时它是一个对话 id(== groupchat id 或 skypename)。

不同的 Skype 实例也会以不同的方式将相同的同步消息分组到聊天中。

所以基本上聊天并不重要,它们任意分组消息,它们不包含关于谁向谁发送了什么的任何关键数据。

这就是我理解其他表格的工作方式:

Contacts- 这是在数据库中提及其Skype名称的每个人,甚至是您从未认识的人(在您当时正在收听的群聊中说了一些话)。is_permanent标记您的联系人列表中的那些。

Conversations- 这是您曾经加入的实际联系人和群聊的结合。这就是人们应该看到的“联系人列表”。如果您需要从未发过消息的联系人,请添加Contacts WHERE is_permanent=1. 如果您只想要当前联系人,请过滤is_bookmarked或类似的东西。

似乎没有重复和分裂。一个联系人 = 一个对话,一个群聊 = 一个对话。如果您正在与联系人一对一交谈并添加了另一方,则之前的消息将保留在该联系人的对话中,而后面的消息将获得自己的对话。

Messages- 这是曾经发送或接收的所有消息和事件:

  • convo_id- 始终设置,始终引用对话。这是您识别消息发送给哪个联系人/群聊的方式。

  • chatname- 始终设置,有时引用来自 Chats 的聊天,有时引用不在 Chats 中的聊天,有时引用来自 Conversations 的群聊 id 或 skypename。大多数情况下,这可以忽略,或者您可以按此字段直观地对消息进行分组。

  • author, from_name- 当时发送此消息的人和他们的昵称始终正确设置。

  • dialog_partner- 非常不可靠,不同PC上相同消息的不同值

  • participant_count- 有时设置,有时不设置,与 dialog_partner 相同:不可靠。

  • identities- 提及与该事件相关的所有Skype名称,或者有时不提及。规则不明确,不可靠。

于 2015-08-13T12:17:17.423 回答