diff options
author | Alexey Shchepin <alexey@process-one.net> | 2003-10-28 20:26:43 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2003-10-28 20:26:43 +0000 |
commit | 188be0dc625be340b06650aaa2cf374d4ce5429b (patch) | |
tree | 51a5494182f4d2cf630fc870b5ebe51ff45942f5 /src/mod_vcard.erl | |
parent | * src/ejabberd_sm.erl: Bugfix (diff) |
* src/ejabberd_listener.erl: Added handling of accept errors,
added timeout value to ssl:accept
* src/mod_vcard.erl: Added checks for all empty input fields
* src/mod_offline.erl: More strong checks for stored packets
SVN Revision: 163
Diffstat (limited to 'src/mod_vcard.erl')
-rw-r--r-- | src/mod_vcard.erl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 70e54cafb..8cf82184b 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -22,6 +22,8 @@ -include("jlib.hrl"). +%-define(JUD_ALLOW_RETURN_ALL, true) + -record(vcard_search, {user, luser, fn, lfn, family, lfamily, @@ -386,6 +388,7 @@ record_to_item(R) -> ] }. +-ifdef(JUD_ALLOW_RETURN_ALL). search(Data) -> MatchSpec = make_matchspec(Data), @@ -397,6 +400,27 @@ search(Data) -> Rs end. +-else. + +search(Data) -> + MatchSpec = make_matchspec(Data), + if + MatchSpec == #vcard_search{_ = '_'} -> + []; + true -> + case catch mnesia:dirty_select(vcard_search, + [{MatchSpec, [], ['$_']}]) of + {'EXIT', Reason} -> + ?ERROR_MSG("~p", [Reason]), + []; + Rs -> + Rs + end + end. + +-endif. + + % TODO: remove % F = fun() -> % mnesia:select(vcard_search, [{MatchSpec, [], ['$_']}]) |