Re: Handling subscription requests
From: Salvatore Iovene <salvatore@xxxxxxxxxx>
Date: Fri, 08 Sep 2006 11:15:59 +0200
On Fri, Sep 08, 2006 at 11:02:00AM +0200, Jakob Schroeter wrote:
> On Friday September 8 2006 10:45, Salvatore Iovene wrote:
> > On Fri, Sep 08, 2006 at 11:32:40AM +0300, Salvatore Iovene wrote:
> > > On Fri, Sep 08, 2006 at 10:16:54AM +0200, Jakob Schroeter wrote:
> > > > No, what I meant to say is that you don't have to use the
> > > > SubscriptionHandler. RosterListener::subscriptionRequest() is the way
> > > > to go for handling subscription requests if you already use the
> > > > RosterManager.
> > >
> > > I use the RosterManager and register my RosterListener like this:
> > >
> > >   m_client->rosterManager()->registerRosterListener(m_rosterListener);
> > >
> > > The roster() methods gets called, so I can receive the contacts in my
> > > roster. But when a contact in my contacts list changes his/her status,
> > > or goes online/offline, none of the following methods are called:
> > >
> > >   presenceUpdated
> > >   itemAvailable
> > >   itemUnavailable
> 
> Please post the xml you receive (using the LogHandler) when a buddy changes 
> presence.
> 

This is all the XML i receive. "salvatore.iovene" is the account running
in Psi, and "siovene" is the one running in my client with gloox.

<?xml version='1.0' ?><stream:stream to='jabber.com'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>
<stream:stream from='jabber.com' id='1248A00007EC9' version='1.0'
xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>
<stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/></stream:features>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
<?xml version='1.0' ?><stream:stream to='jabber.com'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
xml:lang='en' version='1.0'>
<stream:stream from='jabber.com' id='1248A00007EC9' version='1.0'
xml:lang='en' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'/>
<stream:features/>
<iq id='uid1' to='jabber.com' type='get'><query
xmlns='jabber:iq:auth'><username>siovene</username></query></iq>
<iq id='uid1' type='result' xml:lang='en'><query
xmlns='jabber:iq:auth'><username>siovene</username><password/><digest/><resource/></query></iq>
<iq id='uid2' type='set'><query
xmlns='jabber:iq:auth'><username>siovene</username><resource>Rarilliamo</resource><digest>8b3885e030c83525e293699d26a8f06c8256efd0</digest></query></iq>
<iq id='uid2' type='result' xml:lang='en'/>
<iq id='uid3' type='get'><query xmlns='jabber:iq:private'><roster
xmlns='roster:delimiter'/></query></iq>
<iq id='uid4' type='get'><query xmlns='jabber:iq:roster'/></iq>
<iq from='siovene@xxxxxxxxxx/Rarilliamo' id='uid3' type='result'
xml:lang='en'><query xmlns='jabber:iq:private'><roster
xmlns='roster:delimiter'/></query></iq>
<iq from='siovene@xxxxxxxxxx/Rarilliamo' id='uid4' type='result'
xml:lang='en'><query xmlns='jabber:iq:roster'><item
jid='salvatore.iovene@xxxxxxxxxx'
subscription='both'><group>Me</group></item></query></iq>
<presence><priority>3</priority></presence>
<presence from='salvatore.iovene@xxxxxxxxxx' to='siovene@xxxxxxxxxx'
type='subscribed'/>

> > > So I thought there was a subscription problem, like Brian said (even if
> > > from the other jabber client (Psi), it says that I have "both"
> > > subscriptions.
> > > But since I can't get any subscriptions requests (even if from Psi I
> > > click on "re-request authorization), then I'm stuck.
> 
> Servers usually don't bother re-requesting authorization if subscription 
> already is mutual.
 
Ok :)

> > > I have also done like this:
> > >
> > >   m_client->registerSubscriptionHandler(&m_subscriptionHandler);
> > >
> > > And I get the handleSubscription method called once.
> > >
> > > Did these details help you figure out what can be wrong?
> >
> > If it can help, I get these value in the Stanza, when the
> > handleSubscription is called:
> >
> > Type: 3
> 
> This is just a Subscription stanza. The subtype() is the interesting bit here 
> (or the xml).

-- 
Salvatore Iovene
Movial Oy



-- 
gloox-dev mailing list
to unsubscribe:
send a message with subject 'unsubscribe gloox-dev' to minimalist@xxxxxxxxxx