Exemplo n.º 1
0
  /**
   * New message delivery status
   *
   * @param contact Contact
   * @param msgId Message ID
   * @param status Delivery status
   * @param date The server date for delivery status
   */
  public void handleMessageDeliveryStatus(String contact, String msgId, String status, long date) {
    if (logger.isActivated()) {
      logger.debug("Handle message delivery status");
    }

    // Notify listeners
    messagingApi.handleMessageDeliveryStatus(contact, msgId, status, date);
  }
Exemplo n.º 2
0
  /**
   * New ad-hoc group chat session invitation
   *
   * @param session Chat session
   */
  public void handleAdhocGroupChatSessionInvitation(TerminatingAdhocGroupChatSession session) {
    if (logger.isActivated()) {
      logger.debug("Handle event receive ad-hoc group chat session invitation");
    }

    // Broadcast the invitation
    messagingApi.receiveGroupChatInvitation(session);
  }
Exemplo n.º 3
0
  /**
   * New one-to-one chat session invitation
   *
   * @param session Chat session
   */
  public void handleOneOneChatSessionInvitation(TerminatingOne2OneChatSession session) {
    if (logger.isActivated()) {
      logger.debug("Handle event receive 1-1 chat session invitation");
    }

    // Broadcast the invitation
    messagingApi.receiveOneOneChatInvitation(session);
  }
Exemplo n.º 4
0
  /**
   * A new file transfer invitation has been received
   *
   * @param session File transfer session
   * @param isGroup is group file transfer
   */
  public void handleFileTransferInvitation(FileSharingSession session, boolean isGroup) {
    if (logger.isActivated()) {
      logger.debug("Handle event file transfer invitation");
    }

    // Broadcast the invitation
    messagingApi.receiveFileTransferInvitation(session, isGroup);
  }
Exemplo n.º 5
0
  /**
   * Store and Forward messages session invitation
   *
   * @param session Chat session
   */
  public void handleStoreAndForwardMsgSessionInvitation(
      TerminatingStoreAndForwardMsgSession session) {
    if (logger.isActivated()) {
      logger.debug("Handle event S&F messages session invitation");
    }

    // Broadcast the invitation
    messagingApi.receiveOneOneChatInvitation(session);
  }
Exemplo n.º 6
0
  /**
   * One-to-one chat session extended to a group chat session
   *
   * @param groupSession Group chat session
   * @param oneoneSession 1-1 chat session
   */
  public void handleOneOneChatSessionExtended(
      GroupChatSession groupSession, OneOneChatSession oneoneSession) {
    if (logger.isActivated()) {
      logger.debug("Handle event 1-1 chat session extended");
    }

    // Broadcast the event
    messagingApi.extendOneOneChatSession(groupSession, oneoneSession);
  }
Exemplo n.º 7
0
  /**
   * A new file transfer invitation has been received and creating a chat session
   *
   * @param session File transfer session
   * @param chatSession Group chat session
   */
  public void handleGroupFileTransferInvitation(
      FileSharingSession session, TerminatingAdhocGroupChatSession chatSession) {
    if (logger.isActivated()) {
      logger.debug("Handle event file transfer invitation from an existing group chat session");
    }

    // Broadcast the invitation
    messagingApi.receiveFileTransferInvitation(session, chatSession);
  }
Exemplo n.º 8
0
  /**
   * A new file transfer invitation has been received
   *
   * @param session File transfer session
   * @param chatSession Chat session
   */
  public void handle1to1FileTransferInvitation(
      FileSharingSession session, OneOneChatSession chatSession) {
    if (logger.isActivated()) {
      logger.debug("Handle event file transfer invitation from an existing 1-1 chat session");
    }

    // Broadcast the invitation
    messagingApi.receiveFileTransferInvitation(session, chatSession);
  }
Exemplo n.º 9
0
  /**
   * New file delivery status
   *
   * @param ftSessionId File transfer session ID
   * @param status Delivery status
   * @param contact contact who notified delivery
   */
  public void handleFileDeliveryStatus(String ftSessionId, String status, String contact) {
    if (logger.isActivated()) {
      logger.debug(
          "Handle file delivery status: session="
              + ftSessionId
              + " status="
              + status
              + " contact="
              + contact);
    }

    // Notify listeners
    messagingApi.handleFileDeliveryStatus(ftSessionId, status, contact);
  }
Exemplo n.º 10
0
  @Override
  public void onDestroy() {
    // Unregister account changed broadcast receiver
    if (accountChangedReceiver != null) {
      try {
        unregisterReceiver(accountChangedReceiver);
      } catch (IllegalArgumentException e) {
        // Nothing to do
      }
    }

    // Unregister SMS receiver for network initiated configuration
    if (reconfSMSReceiver != null) {
      try {
        reconfSMSReceiver.unregisterSmsProvisioningReceiver();
      } catch (IllegalArgumentException e) {
        // Nothing to do
      }
    }

    // Close APIs
    imsApi.close();
    termsApi.close();
    presenceApi.close();
    capabilityApi.close();
    richcallApi.close();
    ipcallApi.close();
    messagingApi.close();
    sipApi.close();

    // Stop the core
    Thread t =
        new Thread() {
          /** Processing */
          public void run() {
            stopCore();
          }
        };
    t.start();
  }