Skip to content

Commit

Permalink
Merge pull request #3155 from esl/mu-disco-with-dynamic-domains-fix-mam
Browse files Browse the repository at this point in the history
Fix disco for MAM MIM-1412
  • Loading branch information
chrzaszcz authored Jun 16, 2021
2 parents da0d32d + 3e58495 commit 0d82dc9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions big_tests/dynamic_domains.spec
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
{suites, "tests", inbox_extensions_SUITE}.

{suites, "tests", mam_SUITE}.
{skip_cases, "tests", mam_SUITE,
[muc_service_discovery, mam_service_discovery],
"at the moment mod_mam config options don't support dynamic domains"}.
{skip_cases, "tests", mam_SUITE,
[messages_filtered_when_prefs_default_policy_is_roster],
"at the moment mod_roster doesn't support dynamic domains"}.
Expand Down
4 changes: 2 additions & 2 deletions src/mam/mod_mam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ process_mam_iq(Acc, From, To, IQ, _Extra) ->
end.

-spec disco_local_features(mongoose_disco:feature_acc()) -> mongoose_disco:feature_acc().
disco_local_features(Acc = #{to_jid := #jid{lserver = LServer}, node := <<>>}) ->
mongoose_disco:add_features(features(?MODULE, LServer), Acc);
disco_local_features(Acc = #{host_type := HostType, node := <<>>}) ->
mongoose_disco:add_features(features(?MODULE, HostType), Acc);
disco_local_features(Acc) ->
Acc.

Expand Down
4 changes: 2 additions & 2 deletions src/mam/mod_mam_muc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ stop(HostType) ->
%% hooks and handlers for MUC

-spec disco_muc_features(mongoose_disco:feature_acc()) -> mongoose_disco:feature_acc().
disco_muc_features(Acc = #{to_jid := #jid{lserver = LServer}, node := <<>>}) ->
mongoose_disco:add_features(features(?MODULE, LServer), Acc);
disco_muc_features(Acc = #{host_type := HostType, node := <<>>}) ->
mongoose_disco:add_features(features(?MODULE, HostType), Acc);
disco_muc_features(Acc) ->
Acc.

Expand Down
8 changes: 4 additions & 4 deletions src/mam/mod_mam_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -634,14 +634,14 @@ maybe_get_result_namespace(Packet) ->
is_mam_namespace(NS) ->
lists:member(NS, mam_features()).

features(Module, Host) ->
mam_features() ++ retraction_features(Module, Host).
features(Module, HostType) ->
mam_features() ++ retraction_features(Module, HostType).

mam_features() ->
[?NS_MAM_04, ?NS_MAM_06].

retraction_features(Module, Host) ->
case has_message_retraction(Module, Host) of
retraction_features(Module, HostType) ->
case has_message_retraction(Module, HostType) of
true -> [?NS_RETRACT, ?NS_RETRACT_TOMBSTONE];
false -> [?NS_RETRACT]
end.
Expand Down

0 comments on commit 0d82dc9

Please sign in to comment.