Re: Component services, custom requests handling
From: Jakob Schroeter <js@xxxxxxxxxx>
Date: Mon, 01 Jan 2007 22:03:59 +0100
Hi,

On Monday January 1 2007 13:57, Petr Mensik wrote:
> Hello,
>
> i am trying to write some component robot with some bot features. I
> would like to implement some disco browsing of available functions,
> contacts, and maybe some generic listing.
>
> Problem is, i found most handlers are more to handle requests to other
> entities, such as server or contacts from roster. There is disco()
> class, which i can setup with identity, version things. But i did not
> found something, where can i add new items.

You can use DiscoNodeHandler and Disco::registerNodeHandler() for this.


> Also, i would like output be 
> different based on jid, so admin can see more than user. I know i can
> disable disco features of Client and Component. But i dont know where
> can i put my own handlers in case request are arriving to me, not
> responses from what i asked.

Unfortunately, this is not possible with the current DiscoNodeHandler. There 
is no way to know who sent a disco request. I guess this needs fixing.


> Is there some another API, or is it done with normal IqHandler? How can
> i register my class to receive request from other entities, so i can
> write custom disco browsing? Can i register for example generic
> IqHandler, which will handle all packets not handled by ClientBase
> registered IqHandlers? So i can generate custom error responses, or log
> it somehow special (to see what users expect etc.).

It's perfectly possible to use IqHandlers to (re)implement this. (Disco is 
just an IqHandler, too.)

cheers,
Jakob

Attachment: pgpauaUzdCwRQ.pgp
Description: PGP signature

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