25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

Fix export to SQL

This commit is contained in:
Badlop 2010-06-08 20:29:38 +02:00
parent d2dee01f7c
commit be25c5ada7

View File

@ -86,7 +86,8 @@ export_passwd(Server, Output) ->
[] []
end). end).
export_roster(Server, Output) -> export_roster(ServerS, Output) ->
Server = list_to_binary(ServerS),
export_common( export_common(
Server, roster, Output, Server, roster, Output,
fun(Host, #roster{usj = {LUser, LServer, {N, D, Res} = _LJID}} = R) fun(Host, #roster{usj = {LUser, LServer, {N, D, Res} = _LJID}} = R)
@ -148,7 +149,8 @@ export_offline(Server, Output) ->
[] []
end). end).
export_last(Server, Output) -> export_last(ServerS, Output) ->
Server = list_to_binary(ServerS),
export_common( export_common(
Server, last_activity, Output, Server, last_activity, Output,
fun(Host, #last_activity{us = {LUser, LServer}, fun(Host, #last_activity{us = {LUser, LServer},
@ -248,14 +250,15 @@ export_vcard_search(Server, Output) ->
[] []
end). end).
export_private_storage(Server, Output) -> export_private_storage(ServerS, Output) ->
Server = list_to_binary(ServerS),
export_common( export_common(
Server, private_storage, Output, Server, private_storage, Output,
fun(Host, #private_storage{usns = {LUser, LServer, XMLNS}, fun(Host, #private_storage{usns = {LUser, LServer, XMLNS},
xml = Data}) xml = Data})
when LServer == Host -> when LServer == Host ->
Username = ejabberd_odbc:escape(LUser), Username = ejabberd_odbc:escape(LUser),
LXMLNS = ejabberd_odbc:escape(XMLNS), LXMLNS = ejabberd_odbc:escape(atom_to_list(XMLNS)),
SData = ejabberd_odbc:escape( SData = ejabberd_odbc:escape(
exmpp_xml:document_to_list(Data)), exmpp_xml:document_to_list(Data)),
odbc_queries:set_private_data_sql(Username, LXMLNS, SData); odbc_queries:set_private_data_sql(Username, LXMLNS, SData);