Re: Handling subscription requests
From: Salvatore Iovene <salvatore@xxxxxxxxxx>
Date: Fri, 08 Sep 2006 10:12:09 +0200
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?

> The RosterManager builds on top of SubscriptionHandler, though. 
> Stanza::type() 
> and subtype() tell which kind of subscription request you received.

Thanks. I'll read the APIs more carefully and try again.

-- 
Salvatore Iovene
Movial Oy



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