diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2016-11-22 14:48:01 +0100 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2016-11-22 14:48:01 +0100 |
commit | fbfbb968727617ae9bbeedc9b3d4adb7636ad5da (patch) | |
tree | e48dafe80850fe41be32a3ab47f27e6e130b832b /src/mod_vcard_xupdate.erl | |
parent | Add new xmpp repo as dependency in mix.exs (diff) |
Improve ODBC import
Diffstat (limited to 'src/mod_vcard_xupdate.erl')
-rw-r--r-- | src/mod_vcard_xupdate.erl | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/mod_vcard_xupdate.erl b/src/mod_vcard_xupdate.erl index 27688e8fb..4d1dfa2fc 100644 --- a/src/mod_vcard_xupdate.erl +++ b/src/mod_vcard_xupdate.erl @@ -13,14 +13,15 @@ -export([start/2, stop/1]). -export([update_presence/3, vcard_set/3, export/1, - import/1, import/3, mod_opt_type/1, depends/2]). + import_info/0, import/5, import_start/2, + mod_opt_type/1, depends/2]). -include("ejabberd.hrl"). -include("logger.hrl"). -include("xmpp.hrl"). -callback init(binary(), gen_mod:opts()) -> any(). --callback import(binary(), #vcard_xupdate{}) -> ok | pass. +-callback import(binary(), binary(), [binary()]) -> ok. -callback add_xupdate(binary(), binary(), binary()) -> {atomic, any()}. -callback get_xupdate(binary(), binary()) -> binary() | undefined. -callback remove_xupdate(binary(), binary()) -> {atomic, any()}. @@ -94,17 +95,20 @@ presence_with_xupdate(Presence, User, Host) -> Presence1 = xmpp:remove_subtag(Presence, #vcard_xupdate{}), xmpp:set_subtag(Presence1, #vcard_xupdate{hash = Hash}). -export(LServer) -> - Mod = gen_mod:db_mod(LServer, ?MODULE), - Mod:export(LServer). +import_info() -> + [{<<"vcard_xupdate">>, 3}]. -import(LServer) -> - Mod = gen_mod:db_mod(LServer, ?MODULE), - Mod:import(LServer). +import_start(LServer, DBType) -> + Mod = gen_mod:db_mod(DBType, ?MODULE), + Mod:init(LServer, []). -import(LServer, DBType, LA) -> +import(LServer, {sql, _}, DBType, Tab, [LUser, Hash, TimeStamp]) -> Mod = gen_mod:db_mod(DBType, ?MODULE), - Mod:import(LServer, LA). + Mod:import(LServer, Tab, [LUser, Hash, TimeStamp]). + +export(LServer) -> + Mod = gen_mod:db_mod(LServer, ?MODULE), + Mod:export(LServer). mod_opt_type(db_type) -> fun(T) -> ejabberd_config:v_db(?MODULE, T) end; mod_opt_type(_) -> [db_type]. |