0
votes

I'm creating a chat app using the Electron Framework and node-xmpp module for XMPP communication.

I have managed to do almost everything except making Personal Eventing Protocol to work. Specifically sending a new nickname to the roster.

When I send the PEP stanza

<iq from='test@localhost' type='set' id='pub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='http://jabber.org/protocol/nick'>
      <item>
        <nick xmlns='http://jabber.org/protocol/nick'>I am a test user</nick>
      </item>
    </publish>
  </pubsub>
</iq>

I get a response IQ stanza:

<iq from="test@localhost" type="result" to="test@localhost/testapp" id="pub1">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <publish node="http://jabber.org/protocol/nick">
      <item id="5D4E0BB8EB3C6"/>
    </publish>
  </pubsub>
</iq>

Now, according to XEP-172 example 6 I should get a Message with the nickname that is also sent to all my contacts. It should look like this:

<message from='test@localhost' to='otheruser@localhost' type='headline' id='foo'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='http://jabber.org/protocol/nick'>
      <item>
        <nick xmlns='http://jabber.org/protocol/nick'>I am a test user</nick>
      </item>
    </items>
  </event>
  <addresses xmlns='http://jabber.org/protocol/address'>
    <address type='replyto' jid='test@localhost/chatapp'/>
  </addresses>
</message>

The thing is I'm not getting any message to other contacts in the user's roster. Not even to myself.

Is there any step I'm missing to enable PEP on a ejabberd server? Any extra stanza or information I should include?

Thanks!

1

1 Answers

0
votes

If you want to receive other users' nickname events you should include http://jabber.org/protocol/nick+notify string into your Entity Capabilities list.

See Filtered notifications for detailed description.