Uploaded image for project: 'Openfire'
  1. Openfire
  2. OF-1809

DiscoInfoProvider should allow for more than one "Extended Info" form.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.0
    • Component/s: Core
    • Labels:
      None

      Description

      https://xmpp.org/extensions/xep-0128.html#impl defines that a Service Discovery Info response can include more than one "extended info" dataform.

      Openfire should allow for this. It currently allows for at most one form.

      Openfire should be modified to allow for a set of dataforms to be returned. At the same time, it is desirable that the API change does not break existing (third party) code.

      This is probably achieved easiest by adding a new, default method in the DiscoInfoProvider interface, like this:

      /**
       * Returns an XDataForm with the extended information about the entity or null if none. Each bit
       * of information about the entity must be included as a value of a field of the form.
       *
       * @param name the recipient JID's name.
       * @param node the requested disco node.
       * @param senderJID the XMPPAddress of user that sent the disco info request.
       * @return an XDataForm with the extended information about the entity or null if none.
       * @deprecated Replaced by {@link #getExtendedInfos(String, String, JID)}
       */
      @Deprecated
      DataForm getExtendedInfo( String name, String node, JID senderJID );
      
      /**
       * Returns a collection of XDataForm with the extended information about the
       * entity or null if none. Each bit of information about the entity must be
       * included as a value of a field of the form.
       *
       * @param name the recipient JID's name.
       * @param node the requested disco node.
       * @param senderJID the XMPPAddress of user that sent the disco info request.
       * @return A collection of XDataForms with the extended information about the entity or an empty collection if none.
       */
      default Set<DataForm> getExtendedInfos( String name, String node, JID senderJID ) {
          return Collections.singleton( getExtendedInfo( name, node, senderJID ));
      }
      

      All code that calls the old (now deprecated) method, should be modified to now use the result of the new method.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              manasse Manasse Ngudia
              Reporter:
              guus Guus der Kinderen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: