Rewrite mod_irc to use XML generator

This commit is contained in:
Evgeniy Khramtsov 2016-08-03 20:57:05 +03:00
parent 5d06c6acbf
commit a417fbf45b
6 changed files with 972 additions and 1645 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
%% API
-export([init/2, get_data/3, set_data/4, import/2]).
-include("jlib.hrl").
-include("jid.hrl").
-include("mod_irc.hrl").
-include("logger.hrl").

View File

@ -13,7 +13,7 @@
%% API
-export([init/2, get_data/3, set_data/4, import/2]).
-include("jlib.hrl").
-include("jid.hrl").
-include("mod_irc.hrl").
%%%===================================================================

View File

@ -15,7 +15,7 @@
%% API
-export([init/2, get_data/3, set_data/4, import/1, import/2, export/1]).
-include("jlib.hrl").
-include("jid.hrl").
-include("mod_irc.hrl").
-include("ejabberd_sql_pt.hrl").

View File

@ -41,7 +41,7 @@
err_resource_constraint/0, err_resource_constraint/2,
err_service_unavailable/0, err_service_unavailable/2,
err_subscription_required/0, err_subscription_required/2,
err_undefined_condition/0, err_undefined_condition/2,
err_undefined_condition/1, err_undefined_condition/3,
err_unexpected_request/0, err_unexpected_request/2]).
%% XMPP stream errors
@ -567,14 +567,16 @@ err_subscription_required(Text, Lang) ->
err(auth, 'subscription-required', 407, Text, Lang).
%% No error type is defined for <undefined-confition/>.
%% We choose "modify" as it's used in RFC 6120 example.
-spec err_undefined_condition() -> error().
err_undefined_condition() ->
err(modify, 'undefined-condition', 500).
%% Let user provide the type.
-spec err_undefined_condition('auth' | 'cancel' | 'continue' |
'modify' | 'wait') -> error().
err_undefined_condition(Type) ->
err(Type, 'undefined-condition', 500).
-spec err_undefined_condition(binary(), binary() | undefined) -> error().
err_undefined_condition(Text, Lang) ->
err(modify, 'undefined-condition', 500, Text, Lang).
-spec err_undefined_condition('auth' | 'cancel' | 'continue' | 'modify' | 'wait',
binary(), binary() | undefined) -> error().
err_undefined_condition(Type, Text, Lang) ->
err(Type, 'undefined-condition', 500, Text, Lang).
%% RFC 6120 says error type SHOULD be "wait" or "modify".
%% RFC 3920 and XEP-0082 says it SHOULD be "wait".