-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the chat sqlite database #46
Comments
One limitation the chat database has is that contact names are not stored in the database itself. The handle table only has an This data could possibly be gathered using AppleScript and the Contacts app though |
@mitchellkelly I actually did this in a standalone imessage gateway, here: https://github.com/jabyrd3/ymessage/blob/612c40c0487866482339b1cbaa658f6b86c132f7/contacts.mjs#L2 using this: https://github.com/pepebecker/contacts-cli so that i can lookup contact name by id for display in the client |
(don't use that repo though, its a personal project and its not really intended to be installed by anyone else. I am messing with this bridge in an attempt to replace that thing :-X ) |
@jabyrd3 That looks really promising. Thank you for sharing! |
When messages are sent and received on a Mac, there is a Sqlite database that is updated along with the archive files.
All of this info was accurate for Mac OS X 10.12. Things could be different in different OS X versions
The chat database is located at
~/Library/Messages/chat.db
The database provides seven tables: message, attachment, message_attachment_join, handle, chat, chat_handle_join, chat_message_join
Message
The
message
table provides all of the info specific to a single message.message table schema:
Attachment
The
attachment
table provides information about a file that was attached to a message.attachment table schema:
Message / Attachment join
The
message_attachment_join
table is used to create a relationship between messages and attachments. Rows in this table have amessage_id
and anattachment_id
. Both of these fields correspond the aROWID
in their respective tables.message_attachment_join table schema:
Handle
The
handle
table provides information for each iMessage user that has a message stored in themessage
tablehandle table schema:
Chat
The
chat
table provides some information about a room that messages are sent in.chat table schema:
Chat / Handle join
The
chat_handle_join
table is used to create a relationship between thechat
andhandle
tables. Similar to the other join tables, the rows in this table connect aROWID
in thechat
table to aROWID
in thehandle
table.Each row in this table signifies that a specific iMessage user is in a specific chat.
chat_handle_join table schema:
Chat / Message join
The
chat_message_join
table is used to create a relationship between thechat
andmessage
tables. Similar to the other join tables, the rows in this table connect aROWID
in thechat
table to aROWID
in themessage
table.Each row in this table signifies that a specific message belongs to a specific chat.
chat_message_join table schema:
The text was updated successfully, but these errors were encountered: