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

Update version of XEP-0045: Multi-User Chat #4054

Merged
merged 5 commits into from
Jul 14, 2023

Conversation

jacekwegr
Copy link
Contributor

@jacekwegr jacekwegr commented Jul 4, 2023

This PR updates implementation of MUC.
The changes between version 1.25 and 1.34.5 include:

  • Changes in the types of room config options
  • Introduction of <x/> element in MUC-PMs
  • Requirement to maintain the id attribute
  • Removal of Group Chat 1.0 compatibility
  • Use of a delay element in the initial subject message

Link to the full list of changes: https://xmpp.org/extensions/xep-0045.html#appendix-revs

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.03 ⚠️

Comparison is base (8b12212) 83.85% compared to head (0d9d690) 83.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4054      +/-   ##
==========================================
- Coverage   83.85%   83.83%   -0.03%     
==========================================
  Files         526      526              
  Lines       33133    33159      +26     
==========================================
+ Hits        27783    27798      +15     
- Misses       5350     5361      +11     
Impacted Files Coverage Δ
src/mod_muc.erl 75.70% <ø> (ø)
src/mod_muc_room.erl 78.95% <100.00%> (+0.19%) ⬆️

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@jacekwegr jacekwegr marked this pull request as ready for review July 13, 2023 09:43
stanza_groupchat_enter_room(Room, Nick) ->
stanza_to_room(escalus_stanza:presence(<<"available">>), Room, Nick).
stanza_to_room(
escalus_stanza:presence( <<"available">>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
escalus_stanza:presence( <<"available">>,
escalus_stanza:presence(<<"available">>,

stanza_to_room(escalus_stanza:presence(<<"available">>), Room).

stanza_to_room(
escalus_stanza:presence( <<"available">>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
escalus_stanza:presence( <<"available">>,
escalus_stanza:presence(<<"available">>,

stanza_to_room(escalus_stanza:presence(<<"available">>), Room, Nick).
stanza_to_room(
escalus_stanza:presence( <<"available">>,
[#xmlel{ name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[#xmlel{ name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),
[#xmlel{name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),


stanza_to_room(
escalus_stanza:presence( <<"available">>,
[#xmlel{ name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[#xmlel{ name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),
[#xmlel{name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),

@@ -3131,8 +3201,9 @@ disco_info_locked_room(Config) ->
Alice, stanza_to_room(escalus_stanza:iq_get(?NS_DISCO_INFO,[]), RoomName)),

%% THEN receives MUC features
Namespaces = [?NS_MUC, <<"muc_public">>, <<"muc_temporary">>, <<"muc_open">>,
<<"muc_semianonymous">>, <<"muc_moderated">>, <<"muc_unsecured">>],
Namespaces = [?NS_MUC, ?NS_MUC_STABLE_ID,<<"muc_public">>, <<"muc_temporary">>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Namespaces = [?NS_MUC, ?NS_MUC_STABLE_ID,<<"muc_public">>, <<"muc_temporary">>,
Namespaces = [?NS_MUC, ?NS_MUC_STABLE_ID, <<"muc_public">>, <<"muc_temporary">>,

Copy link
Contributor

@JanuszJakubiec JanuszJakubiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I've added minor comments

#xmlel{name = <<"message">>,
attrs = [{<<"to">>, To}, {<<"type">>, <<"chat">>}],
children = [#xmlel{name = <<"body">>,
children = [#xmlcdata{content = Msg}]},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
children = [#xmlcdata{content = Msg}]},
children = [#xmlcdata{content = Msg}]},

children = [#xmlel{name = <<"body">>,
children = [#xmlcdata{content = Msg}]},
#xmlel{name = <<"x">>,
attrs = [{<<"xmlns">>, <<"http://jabber.org/protocol/muc#user">>}]}]}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
attrs = [{<<"xmlns">>, <<"http://jabber.org/protocol/muc#user">>}]}]}.
attrs = [{<<"xmlns">>, <<"http://jabber.org/protocol/muc#user">>}]}]}.

@mongoose-im

This comment was marked as outdated.

children=[#xmlel{name = <<"password">>, children = [#xmlcdata{content=[Password]}]} ]}]),
escalus_stanza:presence(<<"available">>,
[#xmlel{name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}],
children=[#xmlel{name = <<"password">>, children = [#xmlcdata{content=[Password]}]} ]}]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
children=[#xmlel{name = <<"password">>, children = [#xmlcdata{content=[Password]}]} ]}]),
children = [#xmlel{name = <<"password">>, children = [#xmlcdata{content=[Password]}]} ]}]),

stanza_to_room(escalus_stanza:presence(<<"available">>), Room, Nick).
stanza_to_room(
escalus_stanza:presence(<<"available">>,
[#xmlel{name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[#xmlel{name = <<"x">>, attrs=[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),
[#xmlel{name = <<"x">>, attrs = [{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]}]),

Copy link
Contributor

@JanuszJakubiec JanuszJakubiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After rereading the file, I've found some more minor issues.

Copy link
Contributor

@JanuszJakubiec JanuszJakubiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 14, 2023

small_tests_24 / small_tests / 0d9d690
Reports root / small


small_tests_25 / small_tests / 0d9d690
Reports root / small


small_tests_25_arm64 / small_tests / 0d9d690
Reports root / small


ldap_mnesia_24 / ldap_mnesia / 0d9d690
Reports root/ big
OK: 2253 / Failed: 0 / User-skipped: 826 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 0d9d690
Reports root/ big
OK: 4215 / Failed: 0 / User-skipped: 82 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 0d9d690
Reports root/ big
OK: 4215 / Failed: 0 / User-skipped: 82 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 0d9d690
Reports root/ big
OK: 2253 / Failed: 0 / User-skipped: 826 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 0d9d690
Reports root/ big
OK: 4189 / Failed: 0 / User-skipped: 108 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 0d9d690
Reports root/ big
OK: 4212 / Failed: 0 / User-skipped: 85 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 0d9d690
Reports root/ big
OK: 4598 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 0d9d690
Reports root/ big
OK: 2759 / Failed: 0 / User-skipped: 659 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 0d9d690
Reports root/ big
OK: 2399 / Failed: 0 / User-skipped: 680 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 0d9d690
Reports root/ big
OK: 4598 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 0d9d690
Reports root/ big
OK: 4595 / Failed: 0 / User-skipped: 92 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 0d9d690
Reports root/ big
OK: 4584 / Failed: 0 / User-skipped: 103 / Auto-skipped: 0

@JanuszJakubiec JanuszJakubiec merged commit bfc17d8 into master Jul 14, 2023
@JanuszJakubiec JanuszJakubiec deleted the update-multi-user-chat branch July 14, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants