Handle incoherence of argument type in calls to remove_user

This commit is contained in:
Badlop 2010-11-03 13:24:40 +01:00
parent 48dcc5180a
commit 9a32615122
1 changed files with 6 additions and 1 deletions

View File

@ -786,7 +786,12 @@ is_type_match(group, Value, _JID, _Subscription, Groups) ->
lists:member(Value, Groups).
remove_user(User, Server) ->
%% The ejabberd hook provides the arguments as binaries,
%% but the mod_privacy internal functions provide them as strings.
%% Once this module stores information as binaries, this incoherence will be solved.
remove_user(User, Server) when is_binary(User) and is_binary(Server) ->
remove_user(binary_to_list(User), binary_to_list(Server));
remove_user(User, Server) when is_list(User) and is_list(Server) ->
LUser = exmpp_stringprep:nodeprep(User),
LServer = exmpp_stringprep:nameprep(Server),
LServerB = list_to_binary(LServer),