]> granicus.if.org Git - ejabberd/commitdiff
Emit deprecation warning for SM related listening options
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 5 May 2017 09:31:17 +0000 (12:31 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 5 May 2017 09:31:17 +0000 (12:31 +0300)
src/ejabberd_c2s.erl
src/mod_stream_mgmt.erl

index 24db8c1eaf2bcad3a6403676ae5b7b5ad037e418..fae75a4d24b5fa98509422f7f9293362fee5af06 100644 (file)
@@ -941,14 +941,20 @@ listen_opt_type(max_stanza_size) ->
     end;
 listen_opt_type(max_fsm_queue) ->
     fun(I) when is_integer(I), I>0 -> I end;
+%% The following hack should be removed in future releases: it is intended
+%% for backward compatibility with ejabberd 17.01 or older
+listen_opt_type(stream_management) ->
+    ?WARNING_MSG("listening option 'stream_management' is deprecated: "
+                "use mod_stream_mgmt module", []),
+    fun(B) when is_boolean(B) -> B end;
 listen_opt_type(O) ->
-    %% This hack should be removed in future releases: it is intended
-    %% for backward compatibility with ejabberd 17.01 or older
     case mod_stream_mgmt:mod_opt_type(O) of
        L when is_list(L) ->
            [access, shaper, certfile, ciphers, dhfile, cafile,
             protocol_options, tls, tls_compression, starttls,
-            starttls_required, tls_verify, zlib, max_fsm_queue] ++ L;
+            starttls_required, tls_verify, zlib, max_fsm_queue];
        VFun ->
+           ?WARNING_MSG("listening option '~s' is deprecated: use '~s' "
+                        "option from mod_stream_mgmt module", [O, O]),
            VFun
     end.
index 3465ce779dba0783dccd269dfd99650d5fd28d57..7b546465ec52433b0e8c251677d76c014604277b 100644 (file)
@@ -722,8 +722,6 @@ mod_opt_type(resend_on_timeout) ->
     fun(B) when is_boolean(B) -> B;
        (if_offline) -> if_offline
     end;
-mod_opt_type(stream_management) ->
-    fun(B) when is_boolean(B) -> B end;
 mod_opt_type(queue_type) ->
     fun(ram) -> ram; (file) -> file end;
 mod_opt_type(_) ->