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

runfix: conversation admin mutes a single call participant [WPB-5724] #16397

Merged
merged 11 commits into from
Dec 18, 2023

Conversation

PatrykBuniX
Copy link
Contributor

@PatrykBuniX PatrykBuniX commented Dec 18, 2023

BugWPB-5724 [Web] Remote mute one participant in MLS conference call mutes everyone

Description

When muting other people in MLS conversation we need to provide a targets list in REMOTEMUTE type of calling event. A client that receives this event should verify whether it was meant to be muted and whether the event creator is a conversation admin.

Checklist

  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

Important details for the reviewers

(Delete this section if unnecessary)

  • use (x) data
  • can be reviewed commit-by-commit
  • be sure to look at ...

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Merging #16397 (d616ebb) into dev (c21313b) will increase coverage by 0.05%.
Report is 13 commits behind head on dev.
The diff coverage is 59.37%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #16397      +/-   ##
==========================================
+ Coverage   45.52%   45.57%   +0.05%     
==========================================
  Files         732      732              
  Lines       23725    23746      +21     
  Branches     5398     5405       +7     
==========================================
+ Hits        10800    10823      +23     
+ Misses      11557    11549       -8     
- Partials     1368     1374       +6     

@PatrykBuniX PatrykBuniX marked this pull request as ready for review December 18, 2023 13:18
Comment on lines +669 to +689
const isSenderAdmin = conversation.isAdmin(userId);
if (!isSenderAdmin) {
return;
}

const selfUserId = this.selfUser?.qualifiedId;
const selfClientId = this.selfClientId;

if (!selfUserId || !selfClientId) {
return;
}

const isSelfClientTargetted =
!!content.data.targets[selfUserId.domain]?.[selfUserId.id]?.includes(selfClientId);

if (!isSelfClientTargetted) {
return;
}

this.muteCall(call, true, MuteState.REMOTE_MUTED);
return this.processCallingMessage(conversation, event);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change - from now we verify whether a self client is included in targets map and whether event creator is a conversation admin.

this.sendCallingMessage(conversationId, {type: CALL_MESSAGE_TYPE.REMOTE_MUTE}, {nativePush: true, recipients});
this.sendCallingMessage(
conversationId,
{type: CALL_MESSAGE_TYPE.REMOTE_MUTE, data: {targets: recipients}},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When sending a REMOTEMUTE type of calling message, we need to include targets field containing the list of clients that should be muted.

@PatrykBuniX PatrykBuniX merged commit 07763e3 into dev Dec 18, 2023
15 checks passed
@PatrykBuniX PatrykBuniX deleted the runfix/WPB-5724-call-remote-mute branch December 18, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants