niftycode / imessage_reader

Fetch imessages from chat.db
MIT License
90 stars 22 forks source link

Group chat messages excluded from get_message #15

Open SilasStokes opened 1 year ago

SilasStokes commented 1 year ago

After inspecting the database, I think this can be solved with a LEFT JOIN in the sql query. I'll make a pull request when I figure it out.

benrapport commented 1 year ago

hey there! did you happen to sort this out? If not I'll give a go

SilasStokes commented 1 year ago

Hi yes I did - I never did a pr for it (my bad).

I can do a pr tonight but you want to patch your copy really quick I believe I have the changes in the repo of the project i used this package for, linked here: https://github.com/SilasStokes/pymessage_gpt_bot/tree/main/src/imessage_reader

SilasStokes commented 1 year ago

 SQL_CMD = (
        "SELECT "
            "text, "
            "datetime((date / 1000000000) + 978307200, 'unixepoch', 'localtime'),"
            "handle.id, "
            "handle.service, "
            "message.destination_caller_id, "
            "message.is_from_me, "
            "message.attributedBody, "
            "message.cache_roomnames, "
            "chat.display_name "
        "FROM "
            "message "
        "LEFT JOIN "
            "handle on message.handle_id=handle.ROWID "
        "LEFT JOIN "
            "chat ON message.cache_roomnames=chat.chat_identifier "
    )```
benrapport commented 1 year ago

Thank you, Silas!