summaryrefslogtreecommitdiff
path: root/src/mod_vcard_riak.erl
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2016-11-22 14:48:01 +0100
committerChristophe Romain <christophe.romain@process-one.net>2016-11-22 14:48:01 +0100
commitfbfbb968727617ae9bbeedc9b3d4adb7636ad5da (patch)
treee48dafe80850fe41be32a3ab47f27e6e130b832b /src/mod_vcard_riak.erl
parentAdd new xmpp repo as dependency in mix.exs (diff)
Improve ODBC import
Diffstat (limited to 'src/mod_vcard_riak.erl')
-rw-r--r--src/mod_vcard_riak.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mod_vcard_riak.erl b/src/mod_vcard_riak.erl
index 23f05f17..411ec45f 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.
%%%===================================================================