From 9a326151228d7219daf5e161ba2dccf4bc264fd2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 3 Nov 2010 13:24:40 +0100 Subject: [PATCH] Handle incoherence of argument type in calls to remove_user --- src/mod_privacy.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index 1e95553b9..26335d756 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -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),