Create chat room using strophe.js

function createRoom() { var room_name = $('#room').val() + '@conference.localhost/' + sessionStorage.getItem("username");; Chat.mucCreateRoom(room_name); }


var Chat = { mucCreateRoom: function (roomName) { //roomname must be of the format: //'roomName@conference.localhost/nickName' Chat.mucSendPresence(roomName); Chat.connection.muc.createInstantRoom(roomName, function (status) { Chat.log("Succesfully created ChatRoom", status); }, function (status) { Chat.log("Error creating ChatRoom", status); } ); } }

Share This: