コード例 #1
0
ファイル: ParticipantList.java プロジェクト: soitun/collide
 private void addParticipantToView(Participant participant) {
   getView()
       .addParticipant(
           participant.getUserId(),
           participant.getDisplayEmail(),
           participant.getDisplayName(),
           participant.getColor());
 }
コード例 #2
0
 public ParticipantEntity(Participant participant)
 {
     mVersionCode = 3;
     zzatI = participant.getParticipantId();
     zzahh = participant.getDisplayName();
     zzaqW = participant.getIconImageUri();
     zzaqX = participant.getHiResImageUri();
     zzxJ = participant.getStatus();
     zzasH = participant.zztD();
     zzayg = participant.isConnectedToRoom();
     Object obj = participant.getPlayer();
     if (obj == null)
     {
         obj = null;
     } else
     {
         obj = new PlayerEntity(((Player) (obj)));
     }
     zzarZ = ((PlayerEntity) (obj));
     zzTv = participant.getCapabilities();
     zzayh = participant.getResult();
     zzarh = participant.getIconImageUrl();
     zzari = participant.getHiResImageUrl();
 }
コード例 #3
0
  /**
   * Handles presence stanzas
   *
   * @param presence
   */
  private void handlePresence(Presence presence) {
    // unavailable is sent when user leaves the room
    if (!presence.isAvailable()) {
      return;
    }

    String from = presence.getFrom();
    JitsiMeetConference conference = getConferenceForMucJid(from);

    if (conference == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Room not found for JID: " + from);
      }
      return;
    }

    ChatRoomMemberRole role = conference.getRoleForMucJid(from);

    if (role != null && role.compareTo(ChatRoomMemberRole.MODERATOR) < 0) {
      StartMutedPacketExtension ext =
          (StartMutedPacketExtension)
              presence.getExtension(
                  StartMutedPacketExtension.ELEMENT_NAME, StartMutedPacketExtension.NAMESPACE);

      if (ext != null) {
        boolean[] startMuted = {ext.getAudioMuted(), ext.getVideoMuted()};

        conference.setStartMuted(startMuted);
      }
    }

    Participant participant = conference.findParticipantForRoomJid(from);
    ColibriConference colibriConference = conference.getColibriConference();

    if (participant != null && colibriConference != null) {
      // Check if this conference is valid
      String conferenceId = colibriConference.getConferenceId();
      if (StringUtils.isNullOrEmpty(conferenceId)) {
        logger.error("Unable to send DisplayNameChanged event" + " - no conference id");
        return;
      }

      // Check for changes to the display name
      String oldDisplayName = participant.getDisplayName();
      String newDisplayName = null;
      for (PacketExtension pe : presence.getExtensions()) {
        if (pe instanceof Nick) {
          newDisplayName = ((Nick) pe).getName();
          break;
        }
      }

      if (!Objects.equals(oldDisplayName, newDisplayName)) {
        participant.setDisplayName(newDisplayName);

        EventAdmin eventAdmin = FocusBundleActivator.getEventAdmin();
        if (eventAdmin != null) {
          // Prevent NPE when adding to event hashtable
          if (newDisplayName == null) {
            newDisplayName = "";
          }
          eventAdmin.sendEvent(
              EventFactory.endpointDisplayNameChanged(
                  conferenceId, participant.getEndpointId(), newDisplayName));
        }
      }
    }
  }
コード例 #4
0
 static int zza(Participant participant)
 {
     return zzw.hashCode(new Object[] {
         participant.getPlayer(), Integer.valueOf(participant.getStatus()), participant.zztD(), Boolean.valueOf(participant.isConnectedToRoom()), participant.getDisplayName(), participant.getIconImageUri(), participant.getHiResImageUri(), Integer.valueOf(participant.getCapabilities()), participant.getResult(), participant.getParticipantId()
     });
 }