]> granicus.if.org Git - ejabberd/commitdiff
Follow pubsub configuration when using virtual nodetree
authorChristophe Romain <christophe.romain@process-one.net>
Mon, 30 Nov 2015 13:57:21 +0000 (14:57 +0100)
committerChristophe Romain <christophe.romain@process-one.net>
Fri, 11 Dec 2015 11:46:35 +0000 (12:46 +0100)
src/mod_pubsub.erl
src/nodetree_virtual.erl

index 13fe0cc367b0d098558f27553fa999a133c2ba15..deaed10fc3dcf962b41490c4a1d307e04db66fd0 100644 (file)
@@ -83,7 +83,8 @@
 -export([subscription_to_string/1, affiliation_to_string/1,
     string_to_subscription/1, string_to_affiliation/1,
     extended_error/2, extended_error/3, service_jid/1,
-    tree/1, tree/2, plugin/2, config/3, host/1, serverhost/1]).
+    tree/1, tree/2, plugin/2, plugins/1, config/3,
+    host/1, serverhost/1]).
 
 %% API and gen_server callbacks
 -export([start_link/2, start/2, stop/1, init/1,
index d56be860fc164dcd6db42dc43634fee3b83e654e..9797ad8db6443d2bc60d3190609bcf6e24f82979 100644 (file)
@@ -65,10 +65,11 @@ get_node(Host, Node) ->
 
 get_node(Nidx) ->
     {Host, Node} = nodeid(Nidx),
-    Record = #pubsub_node{nodeid = Node, id = Nidx},
-    Module = jlib:binary_to_atom(<<"node_", (Record#pubsub_node.type)/binary>>),
-    Record#pubsub_node{owners = [{<<"">>, Host, <<"">>}],
-       options = Module:options()}.
+    [Type|_] = mod_pubsub:plugins(Host),
+    Module = mod_pubsub:plugin(Host, Type),
+    #pubsub_node{nodeid = Node, id = Nidx, type = Type,
+                 owners = [{<<"">>, Host, <<"">>}],
+                 options = Module:options()}.
 
 get_nodes(Host, _From) ->
     get_nodes(Host).