From 887a65aa18d2264e44923cbe4c47eb2652099157 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 27 Jan 2010 18:53:56 +0000 Subject: [PATCH] exmpp in pubsub doc and retrocompatibility comments (thanks to Karim Gemayel) SVN Revision: 2934 --- src/ejabberd_local.erl | 3 +++ src/ejabberd_router.erl | 3 ++- src/ejabberd_s2s.erl | 2 ++ src/ejabberd_sm.erl | 3 ++- src/mod_pubsub/pubsub.hrl | 34 +++++++++++++++++++++++++--------- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl index 3beeaef17..107aadc0b 100644 --- a/src/ejabberd_local.erl +++ b/src/ejabberd_local.erl @@ -120,6 +120,7 @@ process_iq_reply(From, To, #iq{id = ID} = IQ) -> nothing end. +%% #xmlelement{} used for retro-compatibility route(FromOld, ToOld, #xmlelement{} = PacketOld) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nLOCAL: old #xmlelement:~n~p~n~p~n~n", @@ -232,6 +233,8 @@ handle_cast(_Msg, State) -> %% {stop, Reason, State} %% Description: Handling all non call/cast messages %%-------------------------------------------------------------------- + +%% #xmlelement{} used for retro-compatibility handle_info({route, FromOld, ToOld, #xmlelement{} = PacketOld}, State) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nLOCAL: old #xmlelement:~n~p~n~p~n~n", diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index 21feb6d78..79cc6e1f2 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -63,7 +63,7 @@ start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). - +%% #xmlelement{} used for retro-compatibility route(FromOld, ToOld, #xmlelement{} = PacketOld) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nROUTER: old #xmlelement:~n~p~n~p~n~n", @@ -255,6 +255,7 @@ handle_cast(_Msg, State) -> %% {stop, Reason, State} %% Description: Handling all non call/cast messages %%-------------------------------------------------------------------- +%% #xmlelement{} used for retro-compatibility handle_info({route, FromOld, ToOld, #xmlelement{} = PacketOld}, State) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nROUTER: old #xmlelement:~n~p~n~p~n~n", diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index 94bbafbcb..f5b944977 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -77,6 +77,7 @@ start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). +%% #xmlelement{} used for retro-compatibility route(FromOld, ToOld, #xmlelement{} = PacketOld) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nS2S: old #xmlelement:~n~p~n~p~n~n", @@ -219,6 +220,7 @@ handle_cast(_Msg, State) -> handle_info({mnesia_system_event, {mnesia_down, Node}}, State) -> clean_table_from_bad_node(Node), {noreply, State}; +%% #xmlelement{} used for retro-compatibility handle_info({route, FromOld, ToOld, #xmlelement{} = PacketOld}, State) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nS2S: old #xmlelement:~n~p~n~p~n~n", diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 4207e3b1b..3e5be82f4 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -91,7 +91,7 @@ %%-------------------------------------------------------------------- start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). - +%% #xmlelement{} used for retro-compatibility route(FromOld, ToOld, #xmlelement{} = PacketOld) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nSM: old #xmlelement:~n~p~n~p~n~n", @@ -343,6 +343,7 @@ handle_cast(_Msg, State) -> %% {stop, Reason, State} %% Description: Handling all non call/cast messages %%-------------------------------------------------------------------- +%% #xmlelement{} used for retro-compatibility handle_info({route, FromOld, ToOld, #xmlelement{} = PacketOld}, State) -> catch throw(for_stacktrace), % To have a stacktrace. io:format("~nSM: old #xmlelement:~n~p~n~p~n~n", diff --git a/src/mod_pubsub/pubsub.hrl b/src/mod_pubsub/pubsub.hrl index 3261d5565..5ccd72442 100644 --- a/src/mod_pubsub/pubsub.hrl +++ b/src/mod_pubsub/pubsub.hrl @@ -44,18 +44,34 @@ %%% of the current node. For example: %%% ```["home", "localhost", "cromain", "node1"]'''

-%%% @type stanzaError() = #xmlelement{}. +%%% @type stanzaError() = #xmlel{}. %%% Example: -%%% ```{xmlelement, "error", -%%% [{"code", Code}, {"type", Type}], -%%% [{xmlelement, Condition, [{"xmlns", ?NS_STANZAS}], []}]}''' +%%% ```#xmlel{name = 'error' +%%% ns = ?NS_STANZAS, +%%% attrs = [ +%%% #xmlattr{ +%%% name = 'code', +%%% ns = ?NS_STANZAS, +%%% value = Code +%%% }, +%%% attrs = [ +%%% #xmlattr{ +%%% name = 'type', +%%% ns = ?NS_STANZAS, +%%% value = Type +%%% } +%%% ]}''' -%%% @type pubsubIQResponse() = #xmlelement{}. +%%% @type pubsubIQResponse() = #xmlel{}. %%% Example: -%%% ```{xmlelement, "pubsub", -%%% [{"xmlns", ?NS_PUBSUB_EVENT}], -%%% [{xmlelement, "affiliations", [], -%%% []}]}''' +%%% ```#xmlel{name = 'pubsub', +%%% ns = ?NS_PUBSUB, +%%% children = [ +%%% #xmlel{name = 'affiliations' +%%% ns = ?NS_PUBSUB +%%% } +%%% ] +%%% }''' %%% @type nodeOption() = {Option::atom(), Value::term()}. %%% Example: