How I may do that? Is it possibile to implement a way to remove a PacketListener without the instance reference (XMPPConnection.removeListener(listener))?
The easy way will be adding an getID() method in PacketListener interface, so it’s possibile to removeListenerByID(String id) putting flexibility in Smack library.
You can register your own service discovery code using the Smack configuration file: “smack-config.xml”. This is the file that smack uses to load various core startup classes. Here is the section that you should look at:
You can replace the default service discovery manager class with your own class by changing the first entry.
Can’t we have easy XEP-0128 support by adding a few lines like these to the processPacket() method of the PacketListener that generates responses to disco#info queries in ServiceDiscovery Manager?
if (infoExtension != null) {
response.addExtension(infoExtension);
}
If we define infoExtension to be a field of type DataForm, and define a getter and setter, we should be done.
As far as I can see, this enables you to fully modify the response that Smack generates to disco#info queries.