All pastes #393295 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-13 13:04 UTC
rendered paste body
10:29:47] Cassidy: I have some questions about current pubsub support in ejabberd
[10:30:21] Cassidy: Is it still impossible for users to create a arbitrary node? (have to use home/<server/<users>)
[10:30:27] Cassidy: Does it support collections node ?
[10:30:29] Cassidy: thanks 
[11:07:53] legoscia: Cassidy: yes and not really
[11:08:22] legoscia: ejabberd pubsub nodes are something between leaf nodes and collection nodes, having some traits of each
[11:08:42] legoscia: in particular, it is not possible to subscribe to a "collection" node and receive updates from all its leaves
[11:23:57] Cassidy: legoscia, thanks. Do you know if J-EAI fix the "one user <-> one node" stuff ?
[11:24:09] legoscia: i have no idea
[11:24:30] legoscia: it is not very difficult to create the necessary nodes and set the necessary permissions from the erlang console, though
[11:27:05] Cassidy: legoscia, In fact, I'd need to have a node for each muc. and the creator of the muc will have publish access on it. We can do that?
[11:27:34] legoscia: yes, with some erlang hackery
[11:34:24] Cassidy: legoscia, is it difficult to do? I suppose I'd look like "when a new muc is created, create a node having the same name and give publish perm to its creator" or something
[11:46:07] legoscia: to do something whenever a room is created, it seems that mod_muc_room:init is the right place.  the "create_new_node" and similar functions exported by mod_pubsub do not work; you would need to write another function that does what you want, probably on basis of the hostname of the MUC.  it seems that create_new_node/3 should be called with the JID of the pubsub component as owner.  then set_entities could be used to give the room creator an affiliation of publisher.