OK, thanks Flow. It seems the current implementation of PEP is pretty broken, is it likely to be working in the next release (4.1.4)? I need it working for my project, and tried re-jaring the extensions jar without the pubsub module to overcome the conflict, but this seemed to cause more problems then it solved (couldn’t find the classes when initializing the extensions). Any ideas how I could most easily get it working again?
As far as I can tell, the existing PubSub extension is insufficient for use as a PEP extension. ItemPublishEvent, when passed as a parameter via the ItemEventListener, does not pass the “from” field of the stanza, meaning we cannot tell from which of our contacts the event came from. This is critical - in my case, the payload of the event is less important than knowing from whom the event came from. There seems to be no quick fix for this.
Also, the documentation here for the PubSub extension is wrong and out of date. In general, the documentation is pretty terse and out of date - it would be nice if this could be hosted wiki-style so contributors could easily tidy it up and add our code samples for others.
You can always use a stanza listener to listen for PEP events. See the upcoming changes for PEP in Smack 4.2: Refactor PEP to use PubSub API. · Flowdalic/Smack@33e5c37 · GitHub
Feedback welcomed.
Also, the documentation here for the PubSub extension is wrong and out of date. In general, the documentation is pretty terse and out of date - it would be nice if this could be hosted wiki-style so contributors could easily tidy it up and add our code samples for others.
You are free to
Use Smack’s github wiki
Post the documentation errors in the forums
even better: Issue a PR fixing the documentation errors
I’ve observed that in the PubSub extension, when calling pubSubManager.getNode on a node that hasn’t been created yet, it throws a Throwable (an AssertionError from memory), which jumps past all my exception handlers and crashes the app.
I wonder if this should either be throwing an XMPPException, or possibly just returning null, than this rather heavy-handed death-knell??
If it’s the AssertionError I think it is, then Smack is right to throw it imho. We could introduce an unchecked XmppSpecificationViolationException instead, but this wouldn’t fix the underlying issue: The PubSub component is violating the spec. Go fix it. Until it is fixed, catch the AssertionError and handle it.
I just spend some useless time with getting the PEPManager to work. Plz remove the code or mark as deprecated or something so stupid people (like me) don’t get confused with it.