jdev - 2019-10-12


  1. allie

    anyone here happen to have experience using stanza.io? I'm running into some weird issues with it and I'm not quite sure what to do

  2. allie

    in case anyone happens to stop back by when I'm away, when I use client.getRoomMembers(jid) in stanza.io, I get an error. It looks like it may be sending some type of incorrect/malformed request to the server, so it gets rejected, but I can't figure out what it's supposed to be sending or if I'm missing something. Stanza seems to not have much in the way of documentation.

  3. lovetox

    allie, show us what it sends, and what the response from the server is

  4. allie

    lovetox: I will once I'm back at the computer :)

  5. allie

    lovetox: ugh, I'm not sure which part to show. It seems sometimes it sends an iq to the room JID, but sometimes it's just a mostly empty request? Neither one of them work, though. I'm not sure what is going on or if I'm just using this library incorrectly.

  6. allie

    lovetox: here's the one that's sorta empty: <body xmlns="http://jabber.org/protocol/httpbind" rid="3391751414" sid="ebf40bc3-de75-47d2-9241-e6af623f0417"><r xmlns="urn:xmpp:sm:3"/></body>

  7. allie

    lovetox: and the response to that is: <body sid='ebf40bc3-de75-47d2-9241-e6af623f0417' xmlns:stream='http://etherx.jabber.org/streams' xmlns='http://jabber.org/protocol/httpbind'><iq type='error' to='scc@mbl.social/a3gSsBnh' from='moonbootlabs@chat.mbl.social' id='1891886b-7d9a-4e84-bf83-9c51b6ca8578' xmlns='jabber:client'><error type='cancel'><bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq><a h='7' xmlns='urn:xmpp:sm:3'/></body>

  8. allie

    but sometimes...

  9. Zash

    xep-198 in bosh???

  10. allie

    Zash: I think stanza supports it?

  11. allie

    I'm not enabling anything other than whatever the defaults are, though.

  12. Zash

    But...

  13. allie

    I have no idea

  14. allie

    all of these libraries are just frustrating me. there seems to be almost no documentation. I guess I'm supposed to know how to use everything before knowing how to use it :(

  15. lovetox

    allie, i would disable bosh and connect normaly to start with

  16. lovetox

    and no you didnt post the iq the lib sent

  17. lovetox

    only a streammanagement stanza

  18. allie

    no, I didn't. because now I'm trying to figure out what is actually relevant.

  19. allie

    and what do you mean "connect normally"?

  20. lovetox

    relevant is the iq that has the id 1891886b-7d9a-4e84-bf83-9c51b6ca8578

  21. allie

    k let me look

  22. lovetox

    i thought you writing a client here, are you saying the lib prefers connecting via bosh

  23. lovetox

    and you didnt configure that

  24. allie

    it's a JavaScript library. stanza.io. I don't think it connects any way but bosh or websockets

  25. lovetox

    ah ok my bad then

  26. lovetox

    these bodys is a wrapper

  27. allie

    here's the iq: <body sid='ebf40bc3-de75-47d2-9241-e6af623f0417' xmlns:stream='http://etherx.jabber.org/streams' xmlns='http://jabber.org/protocol/httpbind'><iq type='error' to='scc@mbl.social/a3gSsBnh' from='moonbootlabs@chat.mbl.social' id='1891886b-7d9a-4e84-bf83-9c51b6ca8578' xmlns='jabber:client'><error type='cancel'><bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq><a h='7' xmlns='urn:xmpp:sm:3'/></body>

  28. lovetox

    always look only into whats inside the body tags

  29. lovetox

    yeah you just reposted the error

  30. lovetox

    but there has to be an iq with that id before the error

  31. lovetox

    Iq request has an ID, and the answer reflects that id

  32. lovetox

    you posting the answer

  33. allie

    maybe firefox is getting confused here. let me try to rerun it all. that came from the request body of the client.

  34. allie

    (rather than the response)

  35. allie

    or it's just me, hell if I know

  36. allie

    gimme a sec

  37. lovetox

    and maybe use some paste site

  38. allie

    https://pastebin.com/JAtYkJC7

  39. lovetox

    yeah this is wrong

  40. lovetox

    its missing what affiliation you want to request

  41. lovetox

    are you sure you can set it somewhere on the stanza?

  42. lovetox

    <item affiliation='member'/>

  43. lovetox

    thats how it should look like int the request

  44. allie

    I think it can be set through the options to that function. But there's no documentation that I can find. Let me try something there and see if it works.

  45. lovetox

    it seems you have to create a MUCUserItem and pass it

  46. lovetox

    and in that object you have to set a MUCAffiliation of type member

  47. lovetox

    if you want the member list

  48. lovetox

    and just before you get suprised, member list does not include admins and owner

  49. lovetox

    you have to request the owner list and admin list for that

  50. lovetox

    but i would report it as a bug to the project, that the second argument is optional

  51. lovetox

    this function makes no sense without the second argument

  52. allie

    so, if I add the affiliation and pass it in the way it looks like it is in the source, I get an auth error saying forbidden

  53. lovetox

    yes possible, some servers only allow admins and owners to retrive that list

  54. lovetox

    create a muc on your own and test again

  55. allie

    the request includes <item affiliation="member">

  56. lovetox

    yes then its correct, auth error means you are not allowed

  57. lovetox

    means you are not an admin or owner in this muc

  58. allie

    makes sense

  59. lovetox

    some server allow it some dont

  60. allie

    so if the room is set where only admins/moderators can see JIDs of members, is that what would prevent it?

  61. lovetox

    yes then the server should definitly not send you the list

  62. allie

    so how does a client determine who is in the room?

  63. lovetox

    read XEP-0045

  64. lovetox

    short version, you get a presence stanza of everyone who is in the room currently, on join

  65. allie

    Okay, I think I've got it. All I'm trying to do is make a web-based MUC client that does what I want. But it seems nobody likes to document these libraries.

  66. allie

    thank you for helping me and pointing me in the right direction :)