diff options
Diffstat (limited to 'src/mod_vcard_riak.erl')
-rw-r--r-- | src/mod_vcard_riak.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mod_vcard_riak.erl b/src/mod_vcard_riak.erl index 23f05f17d..411ec45fa 100644 --- a/src/mod_vcard_riak.erl +++ b/src/mod_vcard_riak.erl @@ -12,7 +12,8 @@ %% API -export([init/2, get_vcard/2, set_vcard/4, search/4, remove_user/2, - search_fields/1, search_reported/1, import/2, stop/1]). + search_fields/1, search_reported/1, import/3, stop/1]). +-export([is_search_supported/1]). -include("xmpp.hrl"). -include("mod_vcard.hrl"). @@ -26,6 +27,9 @@ init(_Host, _Opts) -> stop(_Host) -> ok. +is_search_supported(_LServer) -> + false. + get_vcard(LUser, LServer) -> case ejabberd_riak:get(vcard, vcard_schema(), {LUser, LServer}) of {ok, R} -> @@ -101,7 +105,9 @@ search_reported(_LServer) -> remove_user(LUser, LServer) -> {atomic, ejabberd_riak:delete(vcard, {LUser, LServer})}. -import(_LServer, #vcard{us = {LUser, LServer}, vcard = El} = VCard) -> +import(LServer, <<"vcard">>, [LUser, XML, _TimeStamp]) -> + El = fxml_stream:parse_element(XML), + VCard = #vcard{us = {LUser, LServer}, vcard = El}, #vcard_search{fn = FN, lfn = LFN, family = Family, @@ -150,7 +156,7 @@ import(_LServer, #vcard{us = {LUser, LServer}, vcard = El} = VCard) -> {<<"lorgname">>, LOrgName}, {<<"orgunit">>, OrgUnit}, {<<"lorgunit">>, LOrgUnit}]}]); -import(_LServer, #vcard_search{}) -> +import(_LServer, <<"vcard_search">>, _) -> ok. %%%=================================================================== |