Skip to content

Commit

Permalink
Fix exposed namespaces in mam
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed Oct 28, 2021
1 parent 8b1c7fd commit 6481b24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
3 changes: 3 additions & 0 deletions big_tests/tests/mam_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
mam_ns_binary_v04/0,
mam_ns_binary_v06/0,
retract_ns/0,
retract_esl_ns/0,
retract_tombstone_ns/0,
make_alice_and_bob_friends/2,
run_prefs_case/6,
Expand Down Expand Up @@ -231,12 +232,14 @@ namespaces() ->
[mam_ns_binary_v04(),
mam_ns_binary_v06(),
retract_ns(),
retract_esl_ns(),
retract_tombstone_ns()].

mam_ns_binary() -> mam_ns_binary_v04().
mam_ns_binary_v04() -> <<"urn:xmpp:mam:1">>.
mam_ns_binary_v06() -> <<"urn:xmpp:mam:2">>.
retract_ns() -> <<"urn:xmpp:message-retract:0">>.
retract_esl_ns() -> <<"urn:esl:message-retract:0">>.
retract_tombstone_ns() -> <<"urn:xmpp:message-retract:0#tombstone">>.

skip_undefined(Xs) ->
Expand Down
7 changes: 2 additions & 5 deletions big_tests/tests/muc_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2896,11 +2896,8 @@ disco_features_with_mam(Config) ->
?NS_MUC_UNIQUE,
<<"jabber:iq:register">>,
?NS_RSM,
<<"vcard-temp">>,
mam_helper:mam_ns_binary_v04(),
mam_helper:mam_ns_binary_v06(),
mam_helper:retract_ns(),
mam_helper:retract_tombstone_ns()]).
<<"vcard-temp">> |
mam_helper:namespaces()]).

disco_rooms(Config) ->
escalus:fresh_story(Config, [{alice, 1}], fun(Alice) ->
Expand Down
10 changes: 4 additions & 6 deletions big_tests/tests/muc_light_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,10 @@ check_features(Stanza, HasMAM) ->
{attr, <<"var">>}]),
?assertEqual(ExpectedFeatures, ActualFeatures).

expected_features(HasMAM) ->
MamFeatures = case HasMAM of
true -> mam_helper:namespaces();
false -> []
end,
lists:sort([?NS_MUC_LIGHT | MamFeatures]).
expected_features(true) ->
lists:sort([?NS_MUC_LIGHT | mam_helper:namespaces()]);
expected_features(false) ->
[?NS_MUC_LIGHT].

%% The room list is empty. Rooms_per_page set to `infinity`
disco_rooms_empty_page_infinity(Config) ->
Expand Down

0 comments on commit 6481b24

Please sign in to comment.