diff --git a/ChangeLog b/ChangeLog index c535e951c..5fc7ac2f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-12-15 Christophe Romain + + * src/mod_pubsub/mod_pubsub.erl: fix get_item_name deadlock on + transaction + 2008-12-12 Alexey Shchepin * src/ejabberd_c2s.erl: Bugfix in "from" attribute checking diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index 5e0f14232..0306e331e 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -393,9 +393,10 @@ disco_sm_items(Acc, From, To, Node, _Lang) -> fun(#pubsub_item{itemid = Id}) -> %% "jid" is required by XEP-0030, and %% "node" is forbidden by XEP-0060. + {result, Name} = node_action(Host, Node, get_item_name, [Host, Node, Id]), {xmlelement, "item", [{"jid", jlib:jid_to_string(LJID)}, - {"name", get_item_name(Host, Node, Id)}], + {"name", Name}], []} end, AllItems), {result, NodeItems ++ Items} @@ -803,8 +804,9 @@ iq_disco_items(Host, Item, From) -> Items = lists:map( fun(#pubsub_item{itemid = {RN, _}}) -> SN = node_to_string(Node) ++ "!" ++ RN, + {result, Name} = node_call(Type, get_item_name, [Host, Node, RN]), {xmlelement, "item", [{"jid", Host}, {"node", SN}, - {"name", get_item_name(Host, Node, RN)}], []} + {"name", Name}], []} end, NodeItems), {result, Nodes ++ Items} end, @@ -2848,8 +2850,3 @@ uniqid() -> {T1, T2, T3} = now(), lists:flatten(io_lib:fwrite("~.16B~.16B~.16B", [T1, T2, T3])). -%% @doc Return the name of a given node if available. -get_item_name(Host, Node, Id) -> - {result, Name} = node_action(Host, Node, get_item_name, [Host, Node, Id]), - Name. -