Dear all,
I am trying to use the Jabber SDK to create a multi-user chat session using MUCController and MUCRoom functions to enter a room and invite occupants within a previoulsly created room. The issue I am facing is that the 'enter' function doesn't return anything, success callback is not called, error's one neither and the roomEntered event is not triggered. My code looks as follow (assuming client is already connected and working (tested by sending of 1-to-1 messages):
var roster = new jabberwerx.RosterController(client); // Is the roster needed here?
var muc = new jabberwerx.MUCController(client);
var room = muc.room(roomJID); // "newroom@domain"
// Room listeners
room.event('roomEntered').bind(function(evt){
console.log('Room entered event');
// Listeners when room is active
room.event('roomExited').bind(function(evt){
room.destroy();
room = null;
});
room.event('roomBroadcastReceived').bind(function(evt){
var from = evt.data.getFrom();
var body = evt.data.getBody();
console.log('New message from ' + from + ' : ' + body);
});
});
// Room enter
room.enter('my_nickname', {
successCallback: function(){
console.log('Entering room successful');
},
errorCallback: function(err, aborted){
console.log('Error while entering room : ' + err);
room.destroy();
room = null;
}
});
Basically, nothing happens when room.enter is called. If I try to do room.invite after, I get something like:
Uncaught [object Object]
jabberwerx.MUCRoom.jabberwerx.Entity.extend.invite
(anonymous function)
jQuery.event.handle
jQuery.event.add.elemData.handle.eventHandle
I tried to use the multi-user chat with the client software Cisco Jabber and it works with the users I have. So it doesn't seem to be caused by server configuration or users restrictions.
Would you please have an idea of what I may be doing wrong? Thank you very much.
Kind regards,
Clément Tessier