Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-17 13:42:58 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-17 13:42:58 +0300
commit0c4818dacad3b9803b0bb1edbfa90f29abdf5864 (patch)
treedb2180e8c261e3f4c0c507c4d24d84a1422c94be
parent4fe995c272d1897647325465ac0337d00197cbe5 (diff)
Reflect recent pubsub changes in configuration transformer
-rw-r--r--src/ejabberd_config_transformer.erl67
-rw-r--r--src/mod_pubsub.erl4
2 files changed, 51 insertions, 20 deletions
diff --git a/src/ejabberd_config_transformer.erl b/src/ejabberd_config_transformer.erl
index 693d86f1d..19177ba4b 100644
--- a/src/ejabberd_config_transformer.erl
+++ b/src/ejabberd_config_transformer.erl
@@ -343,30 +343,30 @@ transform_module_options(Opts) ->
true
end, Opts).
-transform_module(_Host, mod_http_bind, Opts, Acc) ->
+transform_module(Host, mod_http_bind, Opts, Acc) ->
warn_replaced_module(mod_http_bind, mod_bosh),
- {{mod_bosh, Opts}, Acc};
-transform_module(_Host, mod_vcard_xupdate_odbc, Opts, Acc) ->
+ transform_module(Host, mod_bosh, Opts, Acc);
+transform_module(Host, mod_vcard_xupdate_odbc, Opts, Acc) ->
warn_replaced_module(mod_vcard_xupdate_odbc, mod_vcard_xupdate),
- {{mod_vcard_xupdate, Opts}, Acc};
-transform_module(_Host, mod_vcard_ldap, Opts, Acc) ->
+ transform_module(Host, mod_vcard_xupdate, Opts, Acc);
+transform_module(Host, mod_vcard_ldap, Opts, Acc) ->
warn_replaced_module(mod_vcard_ldap, mod_vcard, ldap),
- {{mod_vcard, [{db_type, ldap}|Opts]}, Acc};
-transform_module(_Host, M, Opts, Acc) when (M == mod_announce_odbc orelse
- M == mod_blocking_odbc orelse
- M == mod_caps_odbc orelse
- M == mod_last_odbc orelse
- M == mod_muc_odbc orelse
- M == mod_offline_odbc orelse
- M == mod_privacy_odbc orelse
- M == mod_private_odbc orelse
- M == mod_pubsub_odbc orelse
- M == mod_roster_odbc orelse
- M == mod_shared_roster_odbc orelse
- M == mod_vcard_odbc) ->
+ transform_module(Host, mod_vcard, [{db_type, ldap}|Opts], Acc);
+transform_module(Host, M, Opts, Acc) when (M == mod_announce_odbc orelse
+ M == mod_blocking_odbc orelse
+ M == mod_caps_odbc orelse
+ M == mod_last_odbc orelse
+ M == mod_muc_odbc orelse
+ M == mod_offline_odbc orelse
+ M == mod_privacy_odbc orelse
+ M == mod_private_odbc orelse
+ M == mod_pubsub_odbc orelse
+ M == mod_roster_odbc orelse
+ M == mod_shared_roster_odbc orelse
+ M == mod_vcard_odbc) ->
M1 = strip_odbc_suffix(M),
warn_replaced_module(M, M1, sql),
- {{M1, [{db_type, sql}|Opts]}, Acc};
+ transform_module(Host, M1, [{db_type, sql}|Opts], Acc);
transform_module(_Host, mod_blocking, Opts, Acc) ->
Opts1 = lists:filter(
fun({db_type, _}) ->
@@ -407,6 +407,34 @@ transform_module(_Host, mod_http_upload, Opts, Acc) ->
true
end, Opts),
{{mod_http_upload, Opts1}, Acc};
+transform_module(_Host, mod_pubsub, Opts, Acc) ->
+ Opts1 = lists:map(
+ fun({plugins, Plugins}) ->
+ {plugins,
+ lists:filter(
+ fun(Plugin) ->
+ case lists:member(
+ Plugin,
+ [<<"buddy">>, <<"club">>, <<"dag">>,
+ <<"dispatch">>, <<"hometree">>, <<"mb">>,
+ <<"mix">>, <<"online">>, <<"private">>,
+ <<"public">>]) of
+ true ->
+ ?WARNING_MSG(
+ "Plugin '~s' of mod_pubsub is not "
+ "supported anymore and has been "
+ "automatically removed from 'plugins' "
+ "option. ~s",
+ [Plugin, adjust_hint()]),
+ false;
+ false ->
+ true
+ end
+ end, Plugins)};
+ (Opt) ->
+ Opt
+ end, Opts),
+ {{mod_pubsub, Opts1}, Acc};
transform_module(_Host, Mod, Opts, Acc) ->
{{Mod, Opts}, Acc}.
@@ -524,6 +552,7 @@ validator() ->
#{'_' =>
econf:options(
#{db_type => econf:atom(),
+ plugins => econf:list(econf:binary()),
'_' => econf:any()},
[])},
[]),
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl
index e80887551..c65b90c60 100644
--- a/src/mod_pubsub.erl
+++ b/src/mod_pubsub.erl
@@ -3892,7 +3892,9 @@ mod_opt_type(nodetree) ->
mod_opt_type(pep_mapping) ->
econf:map(econf:binary(), econf:binary());
mod_opt_type(plugins) ->
- econf:list(econf:binary());
+ econf:list(
+ econf:enum([<<"flat">>, <<"pep">>]),
+ [unique]);
mod_opt_type(host) ->
econf:host();
mod_opt_type(hosts) ->