Пример #1
0
  /**
   * Returns the discovered information of a given XMPP entity addressed by its JID if it's known by
   * the entity caps manager.
   *
   * @param entityID the address of the XMPP entity
   * @return the disovered info or null if no such info is available from the entity caps manager.
   * @throws XMPPException if the operation failed for some reason.
   */
  public DiscoverInfo discoverInfoByCaps(String entityID) throws XMPPException {
    DiscoverInfo info = capsManager.getDiscoverInfoByUser(entityID);

    if (info != null) {
      DiscoverInfo newInfo = cloneDiscoverInfo(info);
      newInfo.setFrom(entityID);
      return newInfo;
    } else {
      return null;
    }
  }
Пример #2
0
 /**
  * Removes from, to and packet-id from <tt>info</tt>.
  *
  * @param info the {@link DiscoverInfo} that we'd like to cleanup.
  */
 private static void cleanupDiscoverInfo(DiscoverInfo info) {
   info.setFrom(null);
   info.setTo(null);
   info.setPacketID(null);
 }