PubSub: Subscribe to item published in other domain

Hi everyone,

cp1@domain1.com creates an node item in pubsub.domain1.com and publishes some items there. cp1@domain1.com wants to add cp1@domain2.com as a subscriber to this created node. When I tried to use the statement

myNode.subscribe("cp1@domain2.com");

an error occured:

<subscribe xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)"/>
<invalid-jid xmlns="[http://jabber.org/protocol/pubsub#errors](http://jabber.org/protocol/pubsub#errors)"/>

Does anyone can help me out in this issue.

Thanks a lot in advance for your help.

You cannot subscribe for a different user. As the docs for the method say, the base JID must match the user making the request. You can only change the resource.

Thank you for your prompt reply.

What do you mean by “You can only change the resource”?

So what can I do in order for one user to publish some information in one node in his server, and for the other user from other server to subscribe to this node and receive updates (pubsub)?

Looking to hear from you asap.

Thanks

Actually, my first statement was incorrect. If you are the admin, or the node owner you can subscribe other people. In you case though, why isn’t the other user subscribing themselves?