aboutsummaryrefslogtreecommitdiff
path: root/src/pubsub_subscription_odbc.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubsub_subscription_odbc.erl')
-rw-r--r--src/pubsub_subscription_odbc.erl46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/pubsub_subscription_odbc.erl b/src/pubsub_subscription_odbc.erl
index 6c99b155d..149308ad0 100644
--- a/src/pubsub_subscription_odbc.erl
+++ b/src/pubsub_subscription_odbc.erl
@@ -1,25 +1,28 @@
-%%% ====================================================================
-%%% ``The contents of this file are subject to the Erlang Public License,
-%%% Version 1.1, (the "License"); you may not use this file except in
-%%% compliance with the License. You should have received a copy of the
-%%% Erlang Public License along with this software. If not, it can be
-%%% retrieved via the world wide web at http://www.erlang.org/.
+%%%----------------------------------------------------------------------
+%%% File : pubsub_subscription_odbc.erl
+%%% Author : Pablo Polvorin <pablo.polvorin@process-one.net>
+%%% Purpose : Handle pubsub subscriptions options with ODBC backend
+%%% based on pubsub_subscription.erl by Brian Cully <bjc@kublai.com>
+%%% Created : 7 Aug 2009 by Pablo Polvorin <pablo.polvorin@process-one.net>
%%%
-%%% Software distributed under the License is distributed on an "AS IS"
-%%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%%% the License for the specific language governing rights and limitations
-%%% under the License.
%%%
-%%% The Initial Developer of the Original Code is ProcessOne.
-%%% Portions created by ProcessOne are Copyright 2006-2015, ProcessOne
-%%% All Rights Reserved.''
-%%% This software is copyright 2006-2015, ProcessOne.
+%%% ejabberd, Copyright (C) 2002-2016 ProcessOne
%%%
-%%% @author Pablo Polvorin <pablo.polvorin@process-one.net>
-%%% @author based on pubsub_subscription.erl by Brian Cully <bjc@kublai.com>
-%%% @version {@vsn}, {@date} {@time}
-%%% @end
-%%% ====================================================================
+%%% This program is free software; you can redistribute it and/or
+%%% modify it under the terms of the GNU General Public License as
+%%% published by the Free Software Foundation; either version 2 of the
+%%% License, or (at your option) any later version.
+%%%
+%%% This program is distributed in the hope that it will be useful,
+%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%%% General Public License for more details.
+%%%
+%%% You should have received a copy of the GNU General Public License along
+%%% with this program; if not, write to the Free Software Foundation, Inc.,
+%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+%%%
+%%%----------------------------------------------------------------------
-module(pubsub_subscription_odbc).
-author("pablo.polvorin@process-one.net").
@@ -27,6 +30,7 @@
%% API
-export([init/0, subscribe_node/3, unsubscribe_node/3,
get_subscription/3, set_subscription/4,
+ make_subid/0,
get_options_xform/2, parse_options_xform/1]).
-include("pubsub.hrl").
@@ -147,7 +151,7 @@ get_options_xform(Lang, Options) ->
++ XFields}}.
parse_options_xform(XFields) ->
- case xml:remove_cdata(XFields) of
+ case fxml:remove_cdata(XFields) of
[#xmlel{name = <<"x">>} = XEl] ->
case jlib:parse_xdata_submit(XEl) of
XData when is_list(XData) ->
@@ -165,7 +169,7 @@ create_table() -> ok.
-spec(make_subid/0 :: () -> mod_pubsub:subId()).
make_subid() ->
- {T1, T2, T3} = now(),
+ {T1, T2, T3} = p1_time_compat:timestamp(),
iolist_to_binary(io_lib:fwrite("~.16B~.16B~.16B", [T1, T2, T3])).
%%