CamHenlin / imessageclient

send and receive iMessages in a terminal or over ssh
866 stars 50 forks source link

Error when launching on Mac OS X 10.8.5 #2

Closed justinmayer closed 9 years ago

justinmayer commented 9 years ago

I'm getting an error when launching version https://github.com/CamHenlin/imessageclient/commit/52685b8644c460ea62eaae572b5c220077f789a9 via Node 0.10.36 on Mac OS X 10.8.5 Mountain Lion:

> node app
we have a file to monitor!
Error: SQLITE_ERROR: no such column: chat.display_name
--> in Database#all('SELECT DISTINCT message.date, handle.id, chat.chat_identifier, chat.display_name  FROM message LEFT OUTER JOIN chat ON chat.room_name = message.cache_roomnames LEFT OUTER JOIN handle ON handle.ROWID = message.handle_id WHERE message.is_from_me = 0 AND message.service = \'iMessage\' ORDER BY message.date DESC', [Function])
    at Database.<anonymous> (/Applications/iMessageClient/app.js:212:6)
    at getChats (/Applications/iMessageClient/app.js:210:5)
    at Object.<anonymous> (/Applications/iMessageClient/app.js:96:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

Any suggestions as to how this might be resolved?

CamHenlin commented 9 years ago

My guess is OS X 10.8 uses a different chat database unfortunately. If I remember right, that Messages client did not support group chats, which is what my script is trying to select the title of. I hate to ask, but any reason for not upgrading to 10.9 or 10.10 since they're free?

justinmayer commented 9 years ago

The machine in question is a four year-old Mac Mini with a Core 2 Duo CPU that is used as a media center. It's downright poky on a good day, and my understanding is that Mountain Lion consumes less CPU cycles than either 10.9 or 10.10, so I'm very reluctant to upgrade to an OS that could negatively affect media playback.

CamHenlin commented 9 years ago

Understandable, do you think you could get me a copy of a chat.db from Mountain Lion? Probably not the one you normally use since I'll be able to read the messages, but maybe create a new OS X account, sign in to iMessages, send a few test messages, then send me the db? I think I can modify this to work on Mountain Lion pretty quickly.

justinmayer commented 9 years ago

Very generous of you, and much appreciated. Here's a test DB: http://mayerz.com/chat.db.zip

Would you let me know once you've retrieved it so I can remove it?

CamHenlin commented 9 years ago

Got it, I’ll see what I can do with it and let you know, thank you

CamHenlin commented 9 years ago

I just pushed an update, would you mind giving it a shot?

justinmayer commented 9 years ago

Error-on-launch resolved. Bravo!

I noticed two other issues when testing via SSH:

  1. Once I send a message, typing a subsequent message in the same conversation results in invisible text (or at least that's what it looks like — cursor advances but without any characters shown during typing)
  2. When sending a message, it seems a "return" character is somehow transmitted to the front-most application. Since this is a media center, this results in Plex activating whatever navigational element is underneath. If this is a movie or TV show, that could result in a very unhappy spouse. ;^)

I'm happy to put these into separate issues if you feel that's appropriate/warranted.

CamHenlin commented 9 years ago

I assume it works otherwise? I just pushed something to fix #2, I think #1 is caused by a problem in the curses library I'm using but I'll look into it more if you create another ticket for it

justinmayer commented 9 years ago

Except for those issues above, it does indeed function as expected. Which, I might add, is just plain awesome. Many thanks for your work on this. Brilliant!