]> granicus.if.org Git - ejabberd/commitdiff
Handle merging of append_host_config as is done for host_config
authorPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 6 Aug 2015 15:45:19 +0000 (17:45 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 6 Aug 2015 15:53:18 +0000 (17:53 +0200)
src/ejabberd_config.erl

index a7ffac7d1dab4a9f3907b744fc53ddd10f9052e6..abb295a75fb22047dc3f69cccc4ce7275d562068 100644 (file)
@@ -378,8 +378,8 @@ get_config_option_key(Name, Val) ->
     end.
 
 maps_to_lists(IMap) ->
-    maps:fold(fun(host_config, Map, Res) ->
-                      [{host_config, [{Host, maps_to_lists(SMap)} || {Host,SMap} <- maps:values(Map)]} | Res];
+    maps:fold(fun(Name, Map, Res) when Name == host_config orelse Name == append_host_config ->
+                      [{Name, [{Host, maps_to_lists(SMap)} || {Host,SMap} <- maps:values(Map)]} | Res];
                  (Name, Map, Res) when is_map(Map) ->
                       [{Name, maps:values(Map)} | Res];
                  (Name, Val, Res) ->
@@ -391,7 +391,7 @@ merge_configs(Terms, ResMap) ->
     lists:foldl(fun({Name, Val}, Map) when is_list(Val) ->
                         Old = maps:get(Name, Map, #{}),
                         New = lists:foldl(fun(SVal, OMap) ->
-                                                  NVal = if Name == host_config ->
+                                                  NVal = if Name == host_config orelse Name == append_host_config ->
                                                                  {Host, Opts} = SVal,
                                                                  {_, SubMap} = maps:get(Host, OMap, {Host, #{}}),
                                                                  {Host, merge_configs(Opts, SubMap)};