Exemplo n.º 1
0
  private void handleColibriIq(ColibriConferenceIQ colibriIQ) {
    ColibriConferenceIQ.Recording recording = colibriIQ.getRecording();
    String from = colibriIQ.getFrom();
    JitsiMeetConference conference = getConferenceForMucJid(colibriIQ.getFrom());
    if (conference == null) {
      logger.debug("Room not found for JID: " + from);
      return;
    }

    JitsiMeetRecording recordingHandler = conference.getRecording();
    if (recordingHandler == null) {
      logger.error("JitsiMeetRecording is null for iq: " + colibriIQ.toXML());

      // Internal server error
      smackXmpp
          .getXmppConnection()
          .sendPacket(
              IQ.createErrorResponse(
                  colibriIQ, new XMPPError(XMPPError.Condition.interna_server_error)));
      return;
    }

    State recordingState =
        recordingHandler.modifyRecordingState(
            colibriIQ.getFrom(),
            recording.getToken(),
            recording.getState(),
            recording.getDirectory(),
            colibriIQ.getTo());

    ColibriConferenceIQ response = new ColibriConferenceIQ();

    response.setType(IQ.Type.RESULT);
    response.setPacketID(colibriIQ.getPacketID());
    response.setTo(colibriIQ.getFrom());
    response.setFrom(colibriIQ.getTo());
    response.setName(colibriIQ.getName());

    response.setRecording(new ColibriConferenceIQ.Recording(recordingState));

    smackXmpp.getXmppConnection().sendPacket(response);
  }
 /**
  * Sets the values of the properties of a specific <tt>ColibriConferenceIQ</tt> to the values of
  * the respective properties of this instance. Thus, the specified <tt>iq</tt> may be thought of
  * as a description of this instance.
  *
  * <p><b>Note</b>: The copying of the values is shallow i.e. the <tt>Content</tt>s of this
  * instance are not described in the specified <tt>iq</tt>.
  *
  * @param iq the <tt>ColibriConferenceIQ</tt> to set the values of the properties of this instance
  *     on
  */
 public void describeShallow(ColibriConferenceIQ iq) {
   iq.setID(getID());
   iq.setName(getName());
 }