I'm trying to get a list of all my chats. There seemed to be something perfect in the API: 'SEARCH ACTIVECHATS'
So, I whip up a simple AppleScript and run that command, getting:
CODE
ERROR 3 Search: unknown WHAT
Question 1: Is 'SEARCH ACTIVECHATS' not implemented? It's in the API doc - maybe it's just not implemented for Mac?
I take a look at some of the other API calls, and while 'SEARCH CHATS' always returns an empty string (""), there's something that seems to work: 'SEARCH RECENTCHATS'. I run this, and get back a nice long string with IDs for a whole bunch of chats.
Now, I take the RECENTCHATS output, slice it up with some regexps and pull out the IDs. And here's where it gets odd...
I send some commands to the API ('GET CHAT <id>', 'GET CHAT <id> TYPE', 'GET CHAT <id> FRIENDLYNAME') with all of the IDs in the array and for a while it works fine. Then the first chat in the list starts responding with:
CODE
ERROR 105 Invalid chat name
Soon enough, all of the chats respond with this, and I can't get anything else. I keep rerunning the 'SEARCH RECENTCHATS' but the IDs haven't changed, and it doesn't help.
Question 2: What on earth is going on? Have I used up a finite number of allowed API calls during the lifespan of a chat? Of my machine? Of the world?