Re: Determinating iChat status
Re: Determinating iChat status
- Subject: Re: Determinating iChat status
- From: Wade Tregaskis <email@hidden>
- Date: Thu, 3 Jun 2004 01:00:06 +1000
1 - Offline
3 - Away (or any variation thereof)
4 - Available (or any variation thereof)
Just an update, 0 = unknown and 2 = idle, as was previously suggested.
You'll get 0 back from address book entries which don't have AIM
handles or whatever. I found this by the +[Person nameOfStatus:]
method and verified it by the correlation between returned status's and
those displayed by iChat.
I've now come across the issue, as has Yann Bizeul I believe, that when
you first request any data about contacts, using one of any of several
methods we've explored, it always fails first time. e.g. if you go
through the people in the address book and request AddressCard's for
each one, the status of each one will be 0 in each case the first time
round, but then will return the proper status every other time.
Similarly if you use +[AddressBookPeople buddies] it returns a list
containing only the 'MeCard', which represents the current user. The
second (and further) time(s) around it returns a list containing the
MeCard, all the Presentity's, and all the AddressCard's for everyone in
the buddy list (fwiw, Presentity's are returned whenever a given buddy
does not have a corresponding address book entry, although I think
Presentity's are at some level used to represent all AIM buddies... I
think each address card have multiple presentity's, etc).
Anyway, it's weird... it seems like you have to actually go through
everything once, then wait some amount of time (a fraction of a second
at the most, although you can't immediately go through again in the
same method... perhaps there's a need for a trip through the runloop or
somesuch). Obviously not a good state of affairs... there must be some
trick, since it makes no logical nor practical sense, but I haven't
found it yet. I haven't noticed this problem in iChat to any real
degree.
For the moment, it's a workaround to just silently do whatever you need
to when your app starts, and that'll get it ready for the real work at
a later point. In my case I haven't had any issues with loss of
functionality after that first run through, although Yann was hinting
that he was seeing something like that. We've both been exploring
different methods, so perhaps there's some rhyme or reason in it all
somewhere.
As always, all this information and any use of the InstantMessage
framework is do-at-your-own-risk, and do so responsibly, etc etc.
Standard disclaimer.
Wade Tregaskis (aim: wadetregaskis)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.