diff options
Diffstat (limited to 'src/pubsub_subscription.erl')
-rw-r--r-- | src/pubsub_subscription.erl | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/src/pubsub_subscription.erl b/src/pubsub_subscription.erl index df1560005..22c904144 100644 --- a/src/pubsub_subscription.erl +++ b/src/pubsub_subscription.erl @@ -1,24 +1,27 @@ -%%% ==================================================================== -%%% ``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.erl +%%% Author : Brian Cully <bjc@kublai.com> +%%% Purpose : Handle pubsub subscriptions options +%%% Created : 29 May 2009 by Brian Cully <bjc@kublai.com> %%% -%%% 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 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). @@ -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]). % Internal function also exported for use in transactional bloc from pubsub plugins @@ -122,7 +126,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) -> @@ -202,7 +206,7 @@ write_subscription(_JID, _NodeId, SubID, Options) -> -spec(make_subid/0 :: () -> SubId::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])). %% |