[ejabberd] to what level is xep-0060 (pub-sub) impelmented

Eric Cestari eric at ohmforce.com
Fri Sep 5 14:09:28 MSD 2008

Le 5 sept. 08 à 04:49, Ovidiu Craciun a écrit :

> I see the discussion is diverging a bit... this is not a bad thing  
> per se :) thanks for all the updates given related with the subject,  
> highly appreciated!
> But back to initial question, I am trying to find out if there's any  
> server out there (open source or commercial) that actually  
> implements the xep-0060 to support the feature I am asking about: to  
> be able to construct a hierarchy of pub-sub nodes (collection nodes  
> containing other collection nodes and leaf nodes) and then to be  
> able to subscribe to *any* collection node and get notified of items  
> published to *any* sub-nodes of the collection node I subscribed to.  
> I would be interested also if there's a server out there that  
> implemented this feature with some limitations: the depth of the  
> hierarchy, the number of parents a node can have (considering the  
> hierarchy that can be built is a directed acyclic graph, or a  
> generic tree structure if restrictions are applied).
> Anyone?

There's anything working like that out of the box to my knowledge.

Though building a custom ejabberd node with the following code could  
get you started.

node_parent.erl :

publish_item(Host, Node, Publisher, Model, MaxItems, ItemId, Payload) ->
	R = node_default:publish_item( Host, SubNode, Publisher, Model,  
MaxItems, ItemId, Payload),
	%% skipping error checking for clarity, but if publishing to current  
node fails, one may not like propagation
	 [H|Tail] = lists:reverse(Node),
	mod_pubsub:publish_item(Host, ServerHost, lists:reverse(Tail),  
Publisher, ItemId, Payload)

I am sure there is unfathomed nasty side effects in this simple  
example, though. (the first one coming to mind is that one would be  
publish items to a collection node, and that's forbidden, right ?)
All the nodes of type node_parent would forward to their parent, and  
to stop that, just put a node default on top.


More information about the ejabberd mailing list