StanzaJS Discussion - 2020-10-02


  1. berry@xeprtc.antillia.io Hello everyone
  2. Lance hiya
  3. berry@xeprtc.antillia.io Is "connected" Event still working ? I was unable to listen to it, I might use auth:success instead
  4. Lance should be, i dont remember changing anything related to it
  5. Lance but session:started is generally the event you want to use
  6. Flavius Andrei hi! how do i send a simple stanza like this?
  7. Flavius Andrei <iq id='1' to='domain.tld' type='get'> <services xmlns='urn:xmpp:extdisco:2'/> </iq>
  8. Flavius Andrei hey, Lance
  9. Flavius Andrei can you please help me a bit?
  10. Flavius Andrei i have no idea how to write a stanza like this :)
  11. Flavius Andrei <iq id='1' to='domain.tld' type='get'>     <services xmlns='urn:xmpp:extdisco:2'/ <xmpp:extdisco:2&apos;/>> </iq>
  12. Lance hiya
  13. Lance yeah
  14. Lance client.getServices is what you want there
  15. Lance getServices('server-jid', undefined, '2') will get the full services list using the :2 namespace
  16. Flavius Andrei this.client.sendIQ({ externalServices: { }, to: 'domain.tld', type: 'get' }).then((r) => console.log('services', r));
  17. Flavius Andrei this uses extdisco:1 but i'm interested in extdisco:2
  18. Lance add version: '2' to that externalServices section and that'll use the :2 version
  19. Flavius Andrei i've tried the version as the third parameter already but it still uses 1 in the xmlns
  20. Lance what stanza version are you running?
  21. Flavius Andrei this.client.getServices('domain.tld', undefined, '2').then((r) => console.log('SERVICES', r));
  22. Flavius Andrei returns
  23. Flavius Andrei <iq xmlns="jabber:client" id="b2862c5b-2cdb-4aa1-aba3-c508069b9199" to="domain.tld" type="get"><services xmlns="urn:xmpp:extdisco:1"/></iq> out>>
  24. Flavius Andrei latest version
  25. Flavius Andrei well, i've built id couple of weeks ago from the repo
  26. Flavius Andrei built it*
  27. Lance that support was recent, trying to find when it was added
  28. Lance no, that was back in May
  29. Lance its supposed to use :2 by default now
  30. Flavius Andrei i didn't see xep-0215 in your list of supported protocols so i imagined you didn't implement it
  31. Flavius Andrei well, it's not :)
  32. Lance just double checking, using stanza 12.14.6 then?
  33. Lance getting local test page fired up to test this
  34. Flavius Andrei changelog says 12.0.0
  35. Lance 12.9.0 is when :2 was set as default
  36. Flavius Andrei i don't remember exactly when i built it, if you have a place where i can check the version...
  37. Lance the main export for stanza has a VERSION field
  38. Flavius Andrei got 12.10 now, i'll build it in a sec
  39. Flavius Andrei is there a doc somewhere describing how to write a stanza? :)
  40. Flavius Andrei because i never knew how to do that
  41. Flavius Andrei even a simple one boggles me
  42. Flavius Andrei yeah, 12.10 did it
  43. Flavius Andrei thanks!
  44. Flavius Andrei how about this.client.discoverICEServers().then((r) => console.log('ICE', r));?
  45. Flavius Andrei it never returns any servers for me…
  46. Lance looking
  47. Lance aha, that's a bug
  48. Lance the point of that function is to seed the ice server config for the jingle plugin, and it does do that
  49. Lance but its just returning an empty list in the end
  50. Lance but the only difference between that function getServices is that it updates the jingle config
  51. Flavius Andrei i see
  52. Flavius Andrei well, thanks for all the help
  53. Flavius Andrei have a nice week-end!
  54. Lance you too!