]> granicus.if.org Git - ejabberd/commitdiff
make virtual nodes having default options
authorChristophe Romain <christophe.romain@process-one.net>
Thu, 2 Jul 2009 10:11:59 +0000 (10:11 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Thu, 2 Jul 2009 10:11:59 +0000 (10:11 +0000)
SVN Revision: 2352

src/mod_pubsub/nodetree_virtual.erl

index 01706560b3676da1ba461b1906e82d1eb2df760f..51b686cecf77ce85c4fc37859ab4cc37ce95ee37 100644 (file)
@@ -93,9 +93,13 @@ set_node(_NodeRecord) ->
 get_node(Host, Node, _From) ->
     get_node(Host, Node).
 get_node(Host, Node) ->
-    #pubsub_node{nodeid = {Host, Node}, id = {Host, Node}, owners = [{"",Host,""}]}.
+    get_node({Host, Node}).
 get_node({Host, _} = NodeId) ->
-    #pubsub_node{nodeid = NodeId, id = NodeId, owners = [{"",Host,""}]}.
+    Record = #pubsub_node{nodeid = NodeId, id = NodeId},
+    Module = list_to_atom("node_" ++ Record#pubsub_node.type),
+    Options = Module:options(),
+    Owners = [{"", Host, ""}],
+    Record#pubsub_node{owners = Owners, options = Options}.
 
 %% @spec (Host) -> [pubsubNode()]
 %%     Host = mod_pubsub:host() | mod_pubsub:jid()