I have been using a PEP plugin (found here: https://github.com/flosse/strophejs-plugins/blob/master/pep/strophe.pep.js) to connect to a users node however I am having some trouble. When my connected block is called I do the following:
XMPP.connection.send($pres());
XMPP.getRoster();
XMPP.connection.addHandler(XMPP.getPresence, null, "presence");
When I receive a subscribed back from the JID of the node I am attempting to access (thus having bidirectional subscription) I execute:
XMPP.connection.pep.subscribe(JID, node,
function(){console.log("SUCCESS: Successfully subscribed to " + JID + "'s node " + node);},
function(){console.log("FAILURE: Unsuccessfully subscribed to " + JID + "'s node " + node);},
XMPP.onMessage,
true);
Where the JID and node are both valid. I receive the SUCCESS in the console however the event handler onMessage is not attached properly. I have debugging set so I can see incoming and outgoing stanzas and I do not receive anything from the node (which I know is being posted on a regular interval). I am not quite sure why this is happening.
If I remove everything from the connected block and simply manually create bidirectional subscription from the web console and add the XMPP.connection.pep.subscribe in that now empty block it works fine.
I have tried multiple PEP and pubsub plugins and get the same behavior. I'm at a road block and would greatly appreciate anyones input! Thanks!