xmpp - Can't send chat message using QuickBlox Javascript SDK -


i'm using quickblox javascript sdk. code i'm using send message chat room:

var msg = {        type: 'chat',        body: $scope.new_chat_message.msg,        extension: {           save_to_history: 1,        } }; qb.chat.send(chat_jid,msg); 

however, 400 bad request when this. may know correct way send message chat room?

we recommend use following snippet example:

function sendmessage(text, attachmentfileid) { var msg = { type: currentdialog.type == 3 ? 'chat' : 'groupchat', body: text, extension: {   save_to_history: 1, }, senderid: currentuser.id,    };   if (currentdialog.type == 3) { opponentid = qb.chat.helpers.getrecipientid(currentdialog.occupants_ids, currentuser.id); qb.chat.send(opponentid, msg);   } else { qb.chat.send(currentdialog.xmpp_room_jid, msg);   } } 

Comments