Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disco for MAM MIM-1412 #3155

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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