25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

Remove compatilibity code.

SVN Revision: 1578
This commit is contained in:
Jean-Sébastien Pédron 2008-09-29 09:42:46 +00:00
parent c32cbd90e8
commit 7624284070
2 changed files with 8 additions and 24 deletions

View File

@ -5,6 +5,8 @@
arguments; this code has not been updated when exmpp_xml's API arguments; this code has not been updated when exmpp_xml's API
changed... changed...
* src/mod_disco.erl: Remove compatilibity code.
2008-09-25 Jean-Sébastien Pédron <js.pedron@meetic-corp.com> 2008-09-25 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* src/jlib.erl (timestamp_to_xml): Create an #xmlel element, not an * src/jlib.erl (timestamp_to_xml): Create an #xmlel element, not an

View File

@ -131,15 +131,11 @@ process_local_iq_items(From, To, #iq{type = get, payload = SubEl,
Host = To#jid.ldomain, Host = To#jid.ldomain,
Node = exmpp_xml:get_attribute(SubEl, 'node', ""), Node = exmpp_xml:get_attribute(SubEl, 'node', ""),
% XXX OLD FORMAT: From, To.
FromOld = jlib:to_old_jid(From),
ToOld = jlib:to_old_jid(To),
case ejabberd_hooks:run_fold(disco_local_items, case ejabberd_hooks:run_fold(disco_local_items,
Host, Host,
empty, empty,
[FromOld, ToOld, Node, Lang]) of [From, To, Node, Lang]) of
{result, Items} -> {result, Items} ->
% XXX OLD FORMAT: Items might be an #xmlelement.
ANode = case Node of ANode = case Node of
"" -> []; "" -> [];
_ -> [#xmlattr{name = 'node', value = Node}] _ -> [#xmlattr{name = 'node', value = Node}]
@ -148,7 +144,6 @@ process_local_iq_items(From, To, #iq{type = get, payload = SubEl,
attrs = ANode, children = Items}, attrs = ANode, children = Items},
exmpp_iq:result(IQ_Rec, Result); exmpp_iq:result(IQ_Rec, Result);
{error, Error} -> {error, Error} ->
% XXX OLD FORMAT: Error.
exmpp_iq:error(IQ_Rec, Error) exmpp_iq:error(IQ_Rec, Error)
end; end;
process_local_iq_items(_From, _To, #iq{type = set} = IQ_Rec) -> process_local_iq_items(_From, _To, #iq{type = set} = IQ_Rec) ->
@ -159,19 +154,14 @@ process_local_iq_info(From, To, #iq{type = get, payload = SubEl,
lang = Lang} = IQ_Rec) -> lang = Lang} = IQ_Rec) ->
Host = To#jid.ldomain, Host = To#jid.ldomain,
Node = exmpp_xml:get_attribute(SubEl, 'node', ""), Node = exmpp_xml:get_attribute(SubEl, 'node', ""),
% XXX OLD FORMAT: From, To.
FromOld = jlib:to_old_jid(From),
ToOld = jlib:to_old_jid(To),
% XXX OLD FORMAT: Identity might be an #xmlelement.
Identity = ejabberd_hooks:run_fold(disco_local_identity, Identity = ejabberd_hooks:run_fold(disco_local_identity,
Host, Host,
[], [],
[FromOld, ToOld, Node, Lang]), [From, To, Node, Lang]),
% XXX OLD FORMAT: From, To.
case ejabberd_hooks:run_fold(disco_local_features, case ejabberd_hooks:run_fold(disco_local_features,
Host, Host,
empty, empty,
[FromOld, ToOld, Node, Lang]) of [From, To, Node, Lang]) of
{result, Features} -> {result, Features} ->
ANode = case Node of ANode = case Node of
"" -> []; "" -> [];
@ -243,7 +233,6 @@ get_local_services({error, _Error} = Acc, _From, _To, _Node, _Lang) ->
Acc; Acc;
get_local_services(Acc, _From, To, [], _Lang) -> get_local_services(Acc, _From, To, [], _Lang) ->
% XXX OLD FORMAT: Items might be an #xmlelement.
Items = case Acc of Items = case Acc of
{result, Its} -> Its; {result, Its} -> Its;
empty -> [] empty -> []
@ -283,13 +272,10 @@ process_sm_iq_items(From, To, #iq{type = get, payload = SubEl,
lang = Lang} = IQ_Rec) -> lang = Lang} = IQ_Rec) ->
Host = To#jid.ldomain, Host = To#jid.ldomain,
Node = exmpp_xml:get_attribute(SubEl, 'node', ""), Node = exmpp_xml:get_attribute(SubEl, 'node', ""),
% XXX OLD FORMAT: From, To.
FromOld = jlib:to_old_jid(From),
ToOld = jlib:to_old_jid(To),
case ejabberd_hooks:run_fold(disco_sm_items, case ejabberd_hooks:run_fold(disco_sm_items,
Host, Host,
empty, empty,
[FromOld, ToOld, Node, Lang]) of [From, To, Node, Lang]) of
{result, Items} -> {result, Items} ->
ANode = case Node of ANode = case Node of
"" -> []; "" -> [];
@ -355,18 +341,14 @@ process_sm_iq_info(From, To, #iq{type = get, payload = SubEl,
lang = Lang} = IQ_Rec) -> lang = Lang} = IQ_Rec) ->
Host = To#jid.ldomain, Host = To#jid.ldomain,
Node = exmpp_xml:get_attribute(SubEl, 'node', ""), Node = exmpp_xml:get_attribute(SubEl, 'node', ""),
% XXX OLD FORMAT: From, To.
FromOld = jlib:to_old_jid(From),
ToOld = jlib:to_old_jid(To),
% XXX OLD FORMAT: Identity might be an #xmlelement.
Identity = ejabberd_hooks:run_fold(disco_sm_identity, Identity = ejabberd_hooks:run_fold(disco_sm_identity,
Host, Host,
[], [],
[FromOld, ToOld, Node, Lang]), [From, To, Node, Lang]),
case ejabberd_hooks:run_fold(disco_sm_features, case ejabberd_hooks:run_fold(disco_sm_features,
Host, Host,
empty, empty,
[FromOld, ToOld, Node, Lang]) of [From, To, Node, Lang]) of
{result, Features} -> {result, Features} ->
ANode = case Node of ANode = case Node of
"" -> []; "" -> [];