Replace regexp with ejabberd_regexp

This commit is contained in:
Evgeniy Khramtsov 2011-12-19 16:10:48 +10:00
parent 298a4a3acf
commit 707bb0a321
1 changed files with 6 additions and 5 deletions

View File

@ -94,17 +94,18 @@ get_user_part(String, Pattern) ->
{'EXIT', _} ->
{error, badmatch};
Result ->
case regexp:sub(Pattern, "%u", Result) of
{ok, StringRes, _} ->
case catch ejabberd_regexp:replace(Pattern, "%u", Result) of
{'EXIT', _} ->
{error, badmatch};
StringRes ->
case (string:to_lower(StringRes) ==
string:to_lower(String)) of
true ->
{ok, Result};
false ->
{error, badmatch}
end;
_ -> {error, badmatch}
end
end
end
end.
make_filter(Data, UIDs) ->