Пример #1
0
  /**
   * The workgroup service may be configured to send email. This queries the Workgroup Service to
   * see if the email service has been configured and is available.
   *
   * @return true if the email service is available, otherwise return false.
   */
  public boolean isEmailAvailable() {
    ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection);

    try {
      String workgroupService = StringUtils.parseServer(workgroupJID);
      DiscoverInfo infoResult = discoManager.discoverInfo(workgroupService);
      return infoResult.containsFeature("jive:email:provider");
    } catch (XMPPException e) {
      return false;
    }
  }