xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.19k stars 372 forks source link

Stanza implementations #832

Closed turanmehmetb closed 4 years ago

turanmehmetb commented 4 years ago

Hi, im trying to send an IQ for room creating.

this.xmppClient.iqCaller.request(
      xml('iq', { type: 'set' }, xml('query', 'http://jabber.org/protocol/muc#owner',
                 xml('x',{xmlns:'jabber:x:data', type:'submit'}))
     ),
      30 * 1000, // 30 seconds timeout - default
      'room@conference.ec2-15-185-81-171.me-south-1.compute.amazonaws.com'
    );

Setting up the iq like this ends with

SENT: <iq type="set" id="907jwsaego" xmlns="jabber:client"><query xmlns="http://jabber.org/protocol/muc#owner"><x xmlns="jabber:x:data" type="submit"/></query></iq>

In return it says: On IQ: <iq type="error" xmlns="jabber:client" to="mbt@ec2-15-185-81-171.me-south-1.compute.amazonaws.com/3TdPKctr" id="907jwsaego"><error type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

In my prosody config file i ve enabled muc and the subdomain so can you guys help me about this one?

sonnyp commented 4 years ago

to should be set as an attribute to the iq not a third argument

There's no third argument for the method request see https://github.com/xmppjs/xmpp.js/tree/master/packages/iq#request

turanmehmetb commented 4 years ago

Oh okay my bad, thank you. I got this but additionally can you say that how can i set this presence

sonnyp commented 4 years ago
xmpp.send(xml('presence', {from: '', to: ''}, xml('x', {xmlns: 'http://jabber.org/protocol/muc'}))