summaryrefslogtreecommitdiff
path: root/src/ejd2odbc.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2012-04-02 15:21:54 +1000
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2012-04-02 15:21:54 +1000
commitca5f028016078244853456cbfdd9bd35b794432a (patch)
tree80b078bcf5909f2e38515ef082437e40feb517a3 /src/ejd2odbc.erl
parentODBC support for mod_announce (diff)
ODBC support for mod_vcard_xupdate
Diffstat (limited to 'src/ejd2odbc.erl')
-rw-r--r--src/ejd2odbc.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ejd2odbc.erl b/src/ejd2odbc.erl
index 4f09cd7b..d9ed2224 100644
--- a/src/ejd2odbc.erl
+++ b/src/ejd2odbc.erl
@@ -34,6 +34,7 @@
export_last/2,
export_vcard/2,
export_vcard_search/2,
+ export_vcard_xupdate/2,
export_private_storage/2,
export_privacy/2,
export_motd/2,
@@ -49,6 +50,7 @@
-record(offline_msg, {us, timestamp, expire, from, to, packet}).
-record(last_activity, {us, timestamp, status}).
-record(vcard, {us, vcard}).
+-record(vcard_xupdate, {us, hash}).
-record(vcard_search, {us,
user, luser,
fn, lfn,
@@ -260,6 +262,20 @@ export_vcard_search(Server, Output) ->
[]
end).
+export_vcard_xupdate(Server, Output) ->
+ export_common(
+ Server, vcard_xupdate, Output,
+ fun(Host, #vcard_xupdate{us = {LUser, LServer}, hash = Hash})
+ when LServer == Host ->
+ Username = ejabberd_odbc:escape(LUser),
+ SHash = ejabberd_odbc:escape(Hash),
+ ["delete from vcard_xupdate where username='", Username, "';"
+ "insert into vcard_xupdate(username, hash) "
+ "values ('", Username, "', '", SHash, "');"];
+ (_Host, _R) ->
+ []
+ end).
+
export_private_storage(Server, Output) ->
export_common(
Server, private_storage, Output,