I am writing a plugin to filter some custom headline messages.
I built a filter as specified in the plugin guidelines, but before reaching the filter, apparently spark removes some information from my messages, because i see them arriving correct (with wireshark) and when i print message.toXML() i see missing fields.
I didn’t want to put my hands on the core.
Do you have any suggestion?
I was wrong, the first error is even worse!
Spark uses Smack behind the scenes to read/parse and send XMPP stanzas. Smack will basically parse only known extensions and will try to do the best with unknown but that usually means just text values in a Map (aka Dictionary). In order to correctly parse your new mytag element you will need to register a new PacketExtensionProvider in Spark so that it can be used by Smack to parse and create the correct packet extension. Check out the Provider Architecture documentation for more information.
Thank you very much!
For quite some days I did some experiment, changing my tags to be sure it wasn’t a namespace conflict, then i started going through the code, and, funny thing, today last thing i read before leaving office was PacketExtensionProvider, and I said: maybe tomorrow i could see the light with that
Good to have a confirmation from you.
By the way, since i will read the documentation tomorrow, little anticipation: i can do it from my plugin, right?
P.S. A general request: since there are still people developing spark, is it possibile to fix the numerous broken link and missing files about Spark plugins, please?
Thank you again Gato
Creating a Provider for the kind of new extension parsed it correctly