user685697
user685697

Reputation: 11

Using Xmpp, strophe.js for chat application

Actually I am trying to create users in the ejabberd server using strophe library.. I got one code for little same like below (this code is developed myself):

chat.js

var stanza = $iq({to: MUC_ROOM + "@" + MUC_COMPONENT, type: 'set', id: 'divReg'})
  .c('query', {xmlns: 'jabber:iq:register'})
  .c('username', GaaChat.gauser)
  .c('password', GaaChat.gapass)
  .tree();
  connection.sendIQ(stanza);

xml format (XEP-0045 multi user chat)

<iq type='set' id='divReg'>
  <query xmlns='jabber:iq:register'>
    <username> bill </username>
    <password> 123 </password>
  </query>
</iq>

The problem is i didnt get any response.. Please tell me above chat.js program is correct or not.. please tell me any other alternatives..

Upvotes: 1

Views: 1879

Answers (1)

ZeroHackeR
ZeroHackeR

Reputation: 31

password will become child object of username. call up() function after username.

http://strophe.im/strophejs/doc/1.0.1/files/core-js.html#Strophe.Builder.up

Upvotes: 3

Related Questions