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

Fix binary arguments

This commit is contained in:
Badlop 2010-06-18 14:03:24 +02:00
parent a62a9b6460
commit 979c2b5a74

View File

@ -117,18 +117,20 @@ xdb_data(_User, _Server, #xmlcdata{}) ->
xdb_data(User, Server, #xmlel{ns = NS} = El) -> xdb_data(User, Server, #xmlel{ns = NS} = El) ->
From = exmpp_jid:make(User, Server), From = exmpp_jid:make(User, Server),
LServer = exmpp_stringprep:nameprep(Server), LServer = exmpp_stringprep:nameprep(Server),
UserB = list_to_binary(User),
ServerB = list_to_binary(Server),
case NS of case NS of
?NS_LEGACY_AUTH -> ?NS_LEGACY_AUTH ->
Password = exmpp_xml:get_cdata(El), Password = exmpp_xml:get_cdata_as_list(El),
ejabberd_auth:set_password(User, Server, Password), ejabberd_auth:set_password(UserB, ServerB, Password),
ok; ok;
?NS_ROSTER -> ?NS_ROSTER ->
case lists:member(mod_roster_odbc, case lists:member(mod_roster_odbc,
gen_mod:loaded_modules(LServer)) of gen_mod:loaded_modules(LServer)) of
true -> true ->
catch mod_roster_odbc:set_items(User, Server, El); catch mod_roster_odbc:set_items(UserB, ServerB, El);
false -> false ->
catch mod_roster:set_items(User, Server, El) catch mod_roster:set_items(UserB, ServerB, El)
end, end,
ok; ok;
?NS_LAST_ACTIVITY -> ?NS_LAST_ACTIVITY ->
@ -138,14 +140,14 @@ xdb_data(User, Server, #xmlel{ns = NS} = El) ->
gen_mod:loaded_modules(LServer)) of gen_mod:loaded_modules(LServer)) of
true -> true ->
catch mod_last_odbc:store_last_info( catch mod_last_odbc:store_last_info(
User, UserB,
Server, ServerB,
list_to_integer(TimeStamp), list_to_integer(TimeStamp),
Status); Status);
false -> false ->
catch mod_last:store_last_info( catch mod_last:store_last_info(
User, UserB,
Server, ServerB,
list_to_integer(TimeStamp), list_to_integer(TimeStamp),
Status) Status)
end, end,
@ -206,7 +208,7 @@ process_offline(Server, To, #xmlel{children = Els}) ->
ok; ok;
_ -> _ ->
ejabberd_hooks:run(offline_message_hook, ejabberd_hooks:run(offline_message_hook,
LServer, list_to_binary(LServer),
[From, To, El]) [From, To, El])
end end
end, Els). end, Els).