Class IQMuclumbusSearchHandler

java.lang.Object
org.jivesoftware.openfire.muc.spi.IQMuclumbusSearchHandler

public class IQMuclumbusSearchHandler extends Object
This class adds support for the search functionality for MUC rooms as identified by the 'https://xmlns.zombofant.net/muclumbus/search/1.0' namespace.
Author:
Guus der Kinderen, guus.der.kinderen@gmail.com
See Also:
  • invalid input: '<a href="https://search.jabbercat.org/docs/api>https://search.jabbercat.org/docs/api</a>'
  • Field Details

  • Constructor Details

    • IQMuclumbusSearchHandler

      public IQMuclumbusSearchHandler(MultiUserChatService mucService)
      Creates a new instance of the search provider.
      Parameters:
      mucService - The server for which to return search results.
  • Method Details

    • handleIQ

      public org.xmpp.packet.IQ handleIQ(org.xmpp.packet.IQ iq)
      Constructs an answer on a IQ stanza that contains a search request. The answer will be an IQ stanza of type 'result' or 'error'.
      Parameters:
      iq - The IQ stanza that is the search request.
      Returns:
      An answer to the provided request.
    • searchForChatrooms

      protected List<MUCRoomSearchInfo> searchForChatrooms(org.jivesoftware.openfire.muc.spi.IQMuclumbusSearchHandler.SearchParameters params)
    • sortByAddress

      public static List<MUCRoomSearchInfo> sortByAddress(List<MUCRoomSearchInfo> mucs)
      Order the provided list by JID of the MUC
      Parameters:
      mucs - The unordered list that will be sorted.
      Returns:
      The order list of MUC rooms.
    • sortByUserAmount

      public static List<MUCRoomSearchInfo> sortByUserAmount(List<MUCRoomSearchInfo> mucs)
      Sorts the provided list in such a way that the MUC with the most users will be the first one in the list.
      Parameters:
      mucs - The unordered list that will be sorted.
      Returns:
      The sorted list of MUC rooms.