From 08a4392fa94e36dae5139d660947f9a3a8d8dd7a Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Thu, 14 Feb 2008 04:51:04 +0000 Subject: [PATCH] * src/mod_roster.erl: Removed the ancient Psi roster workaround * src/mod_roster_odbc.erl: Likewise SVN Revision: 1189 --- ChangeLog | 5 +++++ src/mod_roster.erl | 38 -------------------------------------- src/mod_roster_odbc.erl | 40 +--------------------------------------- 3 files changed, 6 insertions(+), 77 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bc9654c0..817f0bbdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-14 Alexey Shchepin + + * src/mod_roster.erl: Removed the ancient Psi roster workaround + * src/mod_roster_odbc.erl: Likewise + 2008-02-12 Badlop * src/web/ejabberd_web_admin.erl: Fixed native support for all the diff --git a/src/mod_roster.erl b/src/mod_roster.erl index 3ba6949a4..23dd9ee65 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -103,25 +103,6 @@ stop(Host) -> gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_ROSTER). --define(PSI_ROSTER_WORKAROUND, true). - --ifdef(PSI_ROSTER_WORKAROUND). - -process_iq(From, To, IQ) -> - #iq{sub_el = SubEl} = IQ, - #jid{lserver = LServer} = From, - case lists:member(LServer, ?MYHOSTS) of - true -> - ResIQ = process_local_iq(From, To, IQ), - ejabberd_router:route(From, From, - jlib:iq_to_xml(ResIQ)), - ignore; - _ -> - IQ#iq{type = error, sub_el = [SubEl, ?ERR_ITEM_NOT_FOUND]} - end. - --else. - process_iq(From, To, IQ) -> #iq{sub_el = SubEl} = IQ, #jid{lserver = LServer} = From, @@ -132,8 +113,6 @@ process_iq(From, To, IQ) -> IQ#iq{type = error, sub_el = [SubEl, ?ERR_ITEM_NOT_FOUND]} end. --endif. - process_local_iq(From, To, #iq{type = Type} = IQ) -> case Type of set -> @@ -354,21 +333,6 @@ push_item(User, Server, From, Item) -> end, ejabberd_sm:get_user_resources(User, Server)). % TODO: don't push to those who didn't load roster --ifdef(PSI_ROSTER_WORKAROUND). - -push_item(User, Server, Resource, _From, Item) -> - ResIQ = #iq{type = set, xmlns = ?NS_ROSTER, - id = "push", - sub_el = [{xmlelement, "query", - [{"xmlns", ?NS_ROSTER}], - [item_to_xml(Item)]}]}, - ejabberd_router:route( - jlib:make_jid(User, Server, Resource), - jlib:make_jid(User, Server, Resource), - jlib:iq_to_xml(ResIQ)). - --else. - push_item(User, Server, Resource, From, Item) -> ResIQ = #iq{type = set, xmlns = ?NS_ROSTER, id = "push", @@ -380,8 +344,6 @@ push_item(User, Server, Resource, From, Item) -> jlib:make_jid(User, Server, Resource), jlib:iq_to_xml(ResIQ)). --endif. - get_subscription_lists(_, User, Server) -> LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server), diff --git a/src/mod_roster_odbc.erl b/src/mod_roster_odbc.erl index 8248f1dd9..652569853 100644 --- a/src/mod_roster_odbc.erl +++ b/src/mod_roster_odbc.erl @@ -99,25 +99,6 @@ stop(Host) -> gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_ROSTER). --define(PSI_ROSTER_WORKAROUND, true). - --ifdef(PSI_ROSTER_WORKAROUND). - -process_iq(From, To, IQ) -> - #iq{sub_el = SubEl} = IQ, - #jid{lserver = LServer} = From, - case lists:member(LServer, ?MYHOSTS) of - true -> - ResIQ = process_local_iq(From, To, IQ), - ejabberd_router:route(From, From, - jlib:iq_to_xml(ResIQ)), - ignore; - _ -> - IQ#iq{type = error, sub_el = [SubEl, ?ERR_ITEM_NOT_FOUND]} - end. - --else. - process_iq(From, To, IQ) -> #iq{sub_el = SubEl} = IQ, #jid{lserver = LServer} = From, @@ -128,8 +109,6 @@ process_iq(From, To, IQ) -> IQ#iq{type = error, sub_el = [SubEl, ?ERR_ITEM_NOT_FOUND]} end. --endif. - process_local_iq(From, To, #iq{type = Type} = IQ) -> case Type of set -> @@ -390,22 +369,7 @@ push_item(User, Server, From, Item) -> end, ejabberd_sm:get_user_resources(User, Server)). % TODO: don't push to those who not load roster --ifdef(PSI_ROSTER_WORKAROUND). - -push_item(User, Server, Resource, _From, Item) -> - ResIQ = #iq{type = set, xmlns = ?NS_ROSTER, - id = "push", - sub_el = [{xmlelement, "query", - [{"xmlns", ?NS_ROSTER}], - [item_to_xml(Item)]}]}, - ejabberd_router:route( - jlib:make_jid(User, Server, Resource), - jlib:make_jid(User, Server, Resource), - jlib:iq_to_xml(ResIQ)). - --else. - -push_item(User, Resource, From, Item) -> +push_item(User, Server, Resource, From, Item) -> ResIQ = #iq{type = set, xmlns = ?NS_ROSTER, id = "push", sub_el = [{xmlelement, "query", @@ -416,8 +380,6 @@ push_item(User, Resource, From, Item) -> jlib:make_jid(User, Server, Resource), jlib:iq_to_xml(ResIQ)). --endif. - get_subscription_lists(_, User, Server) -> LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server),