I am developing an internal chat system using OpenFire and JsJAC. I wanted everyone logged in to automatically be friends with one another, but since there is no good way to automatically make everyone friends I decided to use the subscription plugin and send along a subscription request to anyone not on your roster. The subscription plugin automatically accepts the request.
This is working now, however I'm unable to set the nickname for the new roster entry.
Here is the code I'm using:
//Send friend request
var subscribe_packet = "<presence to='"+this.sender+"@"+chatManager.args()['domain']+"' from='"+chatManager.args()['username']+"@"+chatManager.args()['domain']+"' type='subscribe'>";
subscribe_packet += "<nick xmlns='http://jabber.org/protocol/nick'>TestTest</nick>";
subscribe_packet += "</presence>";
console.log("Subscribe packet: "+subscribe_packet);
con._sendRaw(subscribe_packet);
This gives the following XML output as an example:
<presence to='[email protected]' from='[email protected]'><nick xmlns='http://jabber.org/protocol/nick'>TestTest</nick></presence>
This sends the subscription request, but the nickname is either not sent or not properly interpreted by OpenFire.
Any thoughts?