At least it's not as late this time. It's still the 24th,
Mountain Standard Time, just after 11:00.
The Jabber
presence system is really difficult to understand
sometimes. I was really getting a bit frustrated with it,
but I may have found the right way to slot code into the ICQ
transport so that the presence will work properly.
The
issue is, for the Jabber user to receive presence info from
an ICQ user, the ICQ user has to be on the contact list.
Unfortunately, since the transport has no way to read the
Jabber user's roster (boy, what a security hole
that'd make), we have to populate the ICQ contact
list indirectly, by watching for presence updates that the
Jabber user sends to the ICQ user. And, in order for those
messages to be passed when the user logs on, the ICQ user
(or, rather, their "proxy" within the Jabber transport) has
to be subscribed to the presence of the Jabber user.
So,
the ICQ user has to send <presence type="subscribe">
to the Jabber user once the Jabber user has subscribed to
the ICQ user. Of course, handling a Jabber user's
subscription request is pretty gnarly in and of
itself:
- Send a "get info" for the ICQ
user.
- When we get the info result back, check the
"authorization requested" flag. If no authorization is
required, we're OK to subscribe.
- If authorization is
required, send back an "authorization request"
message.
- When we get an "authorized" message back,
we're OK to subscribe.
- Once we know we're OK to
subscribe, we can send back the <presence
type="subscribed"> to the Jabber user. Now we
can also send the <presence type="subscribe"> to get
the ICQ proxy subscribing to the Jabber user's
presence.
Sure, it looks uncomplicated on paper.
But, since it's spread across multiple network transactions,
it can get a little unclear and difficult to follow. And,
of course, there's always the possibility that the Jabber
user could
decline the request of the ICQ user to
subscribe to their presence. Of course, if they do, it's
their own damn fault :-).
I couldn't test the new
transport stuff yet, because it was 6:30 and I was late
getting home as it is. Tomorrow, definitely.
I worry
about Pamela sometimes.
No, scratch that; I worry about Pamela a lot. She
hasn't been taking the move to Denver really well, and she
feels lonely and frustrated. Maybe things will look up once
I'm able to get her a car of her own, so she can get out and
do things herself; hopefully, that's something I can do
soon, before her next birthday (in 2 months).