25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00

Fix problems introduced in two recent commits

This commit is contained in:
Badlop 2024-11-25 16:38:34 +01:00
parent da9c591eed
commit cc5c9f6008
2 changed files with 19 additions and 11 deletions

View File

@ -176,9 +176,9 @@ jobs:
apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Enable ModPresenceDemo and an Elixir dependency
- name: Enable Module.Example and an Elixir dependency
run: |
sed -i "s|^modules:|modules:\n 'ModPresenceDemo': {}|g" ejabberd.yml.example
sed -i "s|^modules:|modules:\n 'Ejabberd.Module.Example': {}|g" ejabberd.yml.example
cat ejabberd.yml.example
sed -i 's|^{deps, \[\(.*\)|{deps, [{decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}},\n \1|g' rebar.config
cat rebar.config
@ -257,15 +257,15 @@ jobs:
grep -q '^user3$' registered.log
grep -q 'is started' _build/prod/rel/ejabberd/logs/ejabberd.log
grep -q 'is stopped' _build/prod/rel/ejabberd/logs/ejabberd.log
grep -q 'module Presence Demo' _build/prod/rel/ejabberd/logs/ejabberd.log
grep -q 'Stopping Ejabberd.Module.Example' _build/prod/rel/ejabberd/logs/ejabberd.log
test $(find _build/prod/ -empty -name error.log)
grep -q 'is started' _build/dev/rel/ejabberd/logs/ejabberd.log
grep -q 'is stopped' _build/dev/rel/ejabberd/logs/ejabberd.log
grep -q 'module Presence Demo' _build/dev/rel/ejabberd/logs/ejabberd.log
grep -q 'Stopping Ejabberd.Module.Example' _build/dev/rel/ejabberd/logs/ejabberd.log
test $(find _build/dev/ -empty -name error.log)
grep -q 'is started' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
grep -q 'is stopped' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
grep -q 'module Presence Demo' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
grep -q 'Stopping Ejabberd.Module.Example' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
test $(find /tmp/ejabberd/var/log/ejabberd/ -empty -name error.log)
- name: View logs failures
@ -307,9 +307,9 @@ jobs:
echo "::remove-matcher owner=elixir-mixTestFailure::"
echo "::remove-matcher owner=elixir-dialyzerOutputDefault::"
- name: Enable ModPresenceDemo and an Elixir dependency
- name: Enable Module.Example and an Elixir dependency
run: |
sed -i "s|^modules:|modules:\n 'ModPresenceDemo': {}|g" ejabberd.yml.example
sed -i "s|^modules:|modules:\n 'Ejabberd.Module.Example': {}|g" ejabberd.yml.example
cat ejabberd.yml.example
sed -i 's|^{deps, \(.*\)|{deps, \1\n {decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}}, |g' rebar.config
cat rebar.config
@ -391,15 +391,15 @@ jobs:
grep -q '^user3$' registered.log
grep -q 'is started' _build/prod/rel/ejabberd/logs/ejabberd.log
grep -q 'is stopped' _build/prod/rel/ejabberd/logs/ejabberd.log
grep -q 'module Presence Demo' _build/prod/rel/ejabberd/logs/ejabberd.log
grep -q 'Stopping Ejabberd.Module.Example' _build/prod/rel/ejabberd/logs/ejabberd.log
test $(find _build/prod/ -empty -name error.log)
grep -q 'is started' _build/dev/rel/ejabberd/logs/ejabberd.log
grep -q 'is stopped' _build/dev/rel/ejabberd/logs/ejabberd.log
grep -q 'module Presence Demo' _build/dev/rel/ejabberd/logs/ejabberd.log
grep -q 'Stopping Ejabberd.Module.Example' _build/dev/rel/ejabberd/logs/ejabberd.log
test $(find _build/dev/ -empty -name error.log)
grep -q 'is started' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
grep -q 'is stopped' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
grep -q 'module Presence Demo' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
grep -q 'Stopping Ejabberd.Module.Example' /tmp/ejabberd/var/log/ejabberd/ejabberd.log
test $(find /tmp/ejabberd/var/log/ejabberd/ -empty -name error.log)
- name: View logs failures

View File

@ -1255,12 +1255,20 @@ muc_create_room(HostsDetails, {_, Host, _} = RoomTuple) ->
muc_create_room(ServerHost, RoomTuple, DefRoomOpts).
get_hosts_details(Rooms) ->
Hosts = lists:uniq([Host || {_, Host, _} <- Rooms]),
Hosts = lists_uniq([Host || {_, Host, _} <- Rooms]),
lists:map(fun(H) ->
SH = get_room_serverhost(H),
{H, SH, mod_muc_opt:default_room_options(SH)}
end, Hosts).
-ifdef(OTP_BELOW_25).
lists_uniq(List) ->
lists:usort(List).
-else.
lists_uniq(List) ->
lists:uniq(List).
-endif.
get_host_details(Host, ServerHostsDetails) ->
lists:keyfind(Host, 1, ServerHostsDetails).