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

Get rid of some fuzzy macros as it makes syntax tools getting mad

This commit is contained in:
Evgeniy Khramtsov 2015-05-31 17:56:16 +03:00
parent 100827ec6e
commit 48213b09ce
2 changed files with 22 additions and 24 deletions

View File

@ -173,14 +173,14 @@
%% XEP-0198:
-define(IS_STREAM_MGMT_TAG(Name),
Name == <<"enable">>;
Name == <<"resume">>;
Name == <<"a">>;
Name == <<"r">>).
(Name == <<"enable">>) or
(Name == <<"resume">>) or
(Name == <<"a">>) or
(Name == <<"r">>)).
-define(IS_SUPPORTED_MGMT_XMLNS(Xmlns),
Xmlns == ?NS_STREAM_MGMT_2;
Xmlns == ?NS_STREAM_MGMT_3).
(Xmlns == ?NS_STREAM_MGMT_2) or
(Xmlns == ?NS_STREAM_MGMT_3)).
-define(MGMT_FAILED(Condition, Xmlns),
#xmlel{name = <<"failed">>,

View File

@ -876,27 +876,25 @@ set_room_affiliation(Name, Service, JID, AffiliationString) ->
error
end.
-define(MAKE_CONFIG_OPT(Opt), {Opt, Config#config.Opt}).
make_opts(StateData) ->
Config = StateData#state.config,
[
?MAKE_CONFIG_OPT(title),
?MAKE_CONFIG_OPT(allow_change_subj),
?MAKE_CONFIG_OPT(allow_query_users),
?MAKE_CONFIG_OPT(allow_private_messages),
?MAKE_CONFIG_OPT(public),
?MAKE_CONFIG_OPT(public_list),
?MAKE_CONFIG_OPT(persistent),
?MAKE_CONFIG_OPT(moderated),
?MAKE_CONFIG_OPT(members_by_default),
?MAKE_CONFIG_OPT(members_only),
?MAKE_CONFIG_OPT(allow_user_invites),
?MAKE_CONFIG_OPT(password_protected),
?MAKE_CONFIG_OPT(password),
?MAKE_CONFIG_OPT(anonymous),
?MAKE_CONFIG_OPT(logging),
?MAKE_CONFIG_OPT(max_users),
{title, Config#config.title},
{allow_change_subj, Config#config.allow_change_subj},
{allow_query_users, Config#config.allow_query_users},
{allow_private_messages, Config#config.allow_private_messages},
{public, Config#config.public},
{public_list, Config#config.public_list},
{persistent, Config#config.persistent},
{moderated, Config#config.moderated},
{members_by_default, Config#config.members_by_default},
{members_only, Config#config.members_only},
{allow_user_invites, Config#config.allow_user_invites},
{password_protected, Config#config.password_protected},
{password, Config#config.password},
{anonymous, Config#config.anonymous},
{logging, Config#config.logging},
{max_users, Config#config.max_users},
{affiliations, ?DICT:to_list(StateData#state.affiliations)},
{subject, StateData#state.subject},
{subject_author, StateData#state.subject_author}