From: Jérôme Sautret Date: Tue, 7 Oct 2008 12:32:12 +0000 (+0000) Subject: * src/mod_roster_odbc.erl: fix MySQL multiple requests issue. X-Git-Tag: v2.1.0~18^2~578 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b65caa82fb4f1a0002ac78fb07a0f61ed171d8d1;p=ejabberd * src/mod_roster_odbc.erl: fix MySQL multiple requests issue. SVN Revision: 1612 --- diff --git a/ChangeLog b/ChangeLog index ac18ca157..e28979a4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-10-07 Jerome Sautret + + * src/mod_roster_odbc.erl: fix MySQL multiple requests issue. + 2008-10-06 Badlop * doc/guide.html: Regenerated diff --git a/src/mod_roster_odbc.erl b/src/mod_roster_odbc.erl index 94b45ead8..20655700c 100644 --- a/src/mod_roster_odbc.erl +++ b/src/mod_roster_odbc.erl @@ -16,7 +16,7 @@ %%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %%% General Public License for more details. -%%% +%%% %%% You should have received a copy of the GNU General Public License %%% along with this program; if not, write to the Free Software %%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA @@ -642,7 +642,7 @@ set_items(User, Server, SubEl) -> LServer = jlib:nameprep(Server), catch odbc_queries:sql_transaction( LServer, - lists:map(fun(El) -> + lists:flatmap(fun(El) -> process_item_set_t(LUser, LServer, El) end, Els)). @@ -875,7 +875,7 @@ groups_to_string(#roster{us = {User, _Server}, %% Empty groups do not need to be converted to string to be inserted in %% the database lists:foldl(fun([], Acc) -> Acc; - (Group, Acc) -> + (Group, Acc) -> String = ["'", Username, "'," "'", SJID, "'," "'", ejabberd_odbc:escape(Group), "'"], @@ -1041,4 +1041,3 @@ us_to_list({User, Server}) -> webadmin_user(Acc, _User, _Server, Lang) -> Acc ++ [?XE("h3", [?ACT("roster/", "Roster")])]. -