/**
   * Add discover info response data.
   *
   * @see <a href="http://xmpp.org/extensions/xep-0030.html#info-basic">XEP-30 Basic Protocol;
   *     Example 2</a>
   * @param response the discover info response packet
   */
  public void addDiscoverInfoTo(DiscoverInfo response) {
    // First add the identities of the connection
    response.addIdentities(getIdentities());

    // Add the registered features to the response
    synchronized (features) {
      for (Iterator<String> it = getFeatures(); it.hasNext(); ) {
        response.addFeature(it.next());
      }
      response.addExtension(extendedInfo);
    }
  }
  /**
   * Add discover info response data.
   *
   * @see <a href="http://xmpp.org/extensions/xep-0030.html#info-basic">XEP-30 Basic Protocol;
   *     Example 2</a>
   * @param response the discover info response packet
   */
  public void addDiscoverInfoTo(DiscoverInfo response) {
    // First add the identities of the connection
    response.addIdentities(getIdentities());

    // Add the registered features to the response
    synchronized (features) {
      for (String feature : getFeatures()) {
        response.addFeature(feature);
      }
      response.addExtension(extendedInfo);
    }
  }