CheckJID hook ?

Martin Atkins mart at
Tue Feb 27 20:05:45 UTC 2007

Michael Scherer wrote:

> After problem on my current jabber server, i have decided to give another try 
> to offline message for djabberd, in order to be able to use it, so here is a 
> quick patch for CheckJID.
> It just add a method is_jid_valid, to I think the name could be more 
> explicit, but I didn't found one. Feel free to change it.
> The CheckJID hook take a connection object as parameter, but i didn't see the 
> use, maybe it could be removed from documentation ( I do not even pass it in 
> the implementation, since i do not really know what to pass ) ?

It seems strange to have a hook called CheckJID that accepts a username 
(rather than a whole JID) as an argument. Is CheckJID currently used by 
anything else? I wonder if we could change it to be CheckNodeExists and 
remove that connection parameter to make things a little more sane.

Then I'd make your VHost method be something like node_exists($nodename) 
rather than is_jid_valid, since each vhost can have only one domain so 
there's little point in passing the full JID in here only to have the 
domain and resource parts be ignored.

More information about the Djabberd mailing list