Skip to content

Commit

Permalink
[BugFix] Add (me) suffix to local's user name. Sort participant list (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelprystinka authored Feb 1, 2022
1 parent 378e313 commit fc4d79e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -342,7 +343,7 @@ private void initializeCallNotification() {
private void initParticipantViews() {
// load local participant's view
localParticipantView = new LocalParticipantView(this);
localParticipantView.setDisplayName(callingContext.getDisplayName() + " (Me)");
localParticipantView.setDisplayName(getLocalUserName());
localParticipantView.setVideoDisplayed(callingContext.getCameraOn());
localParticipantView.setSwitchCameraButtonDisplayed(callingContext.getCameraOn());
localParticipantView.setIsMuted(!callingContext.getMicOn());
Expand Down Expand Up @@ -586,18 +587,24 @@ private void openParticipantList() {

private void refreshParticipantList() {
final List<ParticipantInfo> participantInfo = new ArrayList<>();
participantInfo.add(new ParticipantInfo(callingContext.getDisplayName(), !callingContext.getMicOn()));
participantInfo.add(new ParticipantInfo(getLocalUserName(), !callingContext.getMicOn()));
callingContext.getRemoteParticipants().stream().forEach(remoteParticipant ->
participantInfo.add(new ParticipantInfo(remoteParticipant.getDisplayName(),
remoteParticipant.isMuted())));

participantInfo.sort(Comparator.comparing(a -> a.getDisplayName().toLowerCase()));

if (participantListPopupWindow == null) {
participantListPopupWindow = new ParticipantListPopupWindow(this, participantInfo);
}

participantListPopupWindow.setParticipantInfo(participantInfo);
}

private String getLocalUserName() {
return callingContext.getDisplayName().isEmpty() ? "(me)" : callingContext.getDisplayName() + " (me)";
}

private void openHangupDialog() {
if (callHangupOverlay.getVisibility() != View.VISIBLE) {
callHangupOverlay.setVisibility(View.VISIBLE);
Expand Down

0 comments on commit fc4d79e

Please sign in to comment.