Re: Handling subscription requests
From: Salvatore Iovene <salvatore@xxxxxxxxxx>
Date: Fri, 08 Sep 2006 10:42:24 +0200
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:
> > On Friday September 8 2006 10:15, Salvatore Iovene wrote:
> > > On Fri, Sep 08, 2006 at 09:41:42AM +0200, Jakob Schroeter wrote:
> > > > On Friday September 8 2006 09:30, Salvatore Iovene wrote:
> > > > > On Fri, 2006-09-08 at 00:05 +0200, Jakob Schroeter wrote:
> > > > > > On Thursday September 7 2006 23:56, Brian Arandez wrote:
> > > > > > > On 09 8, 06, at 5:27 AM, Salvatore Iovene wrote:
> > > > > > > > On Tue, 2006-09-05 at 16:59 +0300, Salvatore iovene wrote:
> > > > > > > >> Hello,
> > > > > > > >> where can I find an example on how to handle subscription
> > > > > > > >> requests? I see that there's the SubscriptionHandler class. Do 
> > > > > > > >> I
> > > > > > > >> need to subclass
> > > > > > > >> it and then reimplement the handleSubscription method?
> > > > > > > >> And what then?
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > > can anybody help about it, please?
> > > > > > > > Thanks...
> > > > > > > >
> > > > > > > > --
> > > > > > > > Salvatore Iovene
> > > > > > > > http://www.iovene.com
> > > > > > >
> > > > > > > Hi. have you tried checking the src/tests/roster_test.cpp?
> > > > > > >
> > > > > > > specifically:
> > > > > > >
> > > > > > > virtual bool subscriptionRequest( const std::string& jid, const
> > > > > > > std::string& /*msg*/ );
> > > > > > >
> > > > > > > nothing too complex... but it provides a great foundation on the
> > > > > > > basics.
> > > > >
> > > > > I have tried that and those methods don't get ever called.
> > > > >
> > > > > > Yeah, this, and don't forget to
> > > > > > Client::registerSubscriptionHandler().
> > > > >
> > > > > handleSubscription gets called, instead. How do I then use the Stanza
> > > > > to understand what type of request it was?
> > > >
> > > > Mea culpa, subscriptionRequest() (and unsubscriptionRequest()) is from
> > > > RosterListener, of course.
> > >
> > > Does this mean that I shouldn't use those 2 methods?
> > 
> > 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
> 
> 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.
> 
> 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
From: salvatore.iovene@xxxxxxxxxx
Subject: 
Body: 
Error: 0
Error text:

-- 
Salvatore Iovene
Movial Oy



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