I'm trying to sort out how to get a bot to deal with subscriptions and the RFC is just confusing me -- it switches between what a server should do and what a client should do too often!

The docs here: http://wiki.jabber.org/index.php/Programming_Jabber_Clients :are really good .. but they don't talk about subscriptions at all.

Can someone help me work this out?

I'm using the perl module Net::XMPP if anyone has any code lying around :-D

I want to receive subscription requests and, if the subscriber matches particular criteria I want to accept the subscription. If they don't, I want to refuse it.

It all feels rather easy really. But GMail users are telling me that the bot never appears on their user list. I use gaim personally, and have no problem at all. Parts of the RFC make me think I need to manually update the roster, and then other parts make me think the server will do all that for me.

I figure I should be putting my handling in a place that handles 'subscribe' presences: <presence from='[EMAIL PROTECTED]' to='[EMAIL PROTECTED]/bot' type='subscribe'/>

And I figure that I should reply with a 'subscribed' presence:
$Connection->Subscription(
        type => "subscribed",
        to   => '[EMAIL PROTECTED]'
);

Should I then follow that up with a reciprocal 'subscribe' request?
$Connection->Subscription(
        type => "subscribe",
        to   => '[EMAIL PROTECTED]'
);

Coz that's what I'm doing .. and it doesn't seem to be working. When I look at my 'roster', there's a lot of 'None' in there ... which leads me to think maybe I have to update the roster myself. But I tried that, and getting the roster again showed that it hadn't changed at all.

ANY help would be greatly appreciated.

Cheers!
Rick Measham

















Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to