-
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
-
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.
-
lovetox
allie, show us what it sends, and what the response from the server is
-
allie
lovetox: I will once I'm back at the computer :)
-
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.
-
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>
-
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>
-
allie
but sometimes...
-
Zash
xep-198 in bosh???
-
allie
Zash: I think stanza supports it?
-
allie
I'm not enabling anything other than whatever the defaults are, though.
-
Zash
But...
-
allie
I have no idea
-
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 :(
-
lovetox
allie, i would disable bosh and connect normaly to start with
-
lovetox
and no you didnt post the iq the lib sent
-
lovetox
only a streammanagement stanza
-
allie
no, I didn't. because now I'm trying to figure out what is actually relevant.
-
allie
and what do you mean "connect normally"?
-
lovetox
relevant is the iq that has the id 1891886b-7d9a-4e84-bf83-9c51b6ca8578
-
allie
k let me look
-
lovetox
i thought you writing a client here, are you saying the lib prefers connecting via bosh
-
lovetox
and you didnt configure that
-
allie
it's a JavaScript library. stanza.io. I don't think it connects any way but bosh or websockets
-
lovetox
ah ok my bad then
-
lovetox
these bodys is a wrapper
-
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>
-
lovetox
always look only into whats inside the body tags
-
lovetox
yeah you just reposted the error
-
lovetox
but there has to be an iq with that id before the error
-
lovetox
Iq request has an ID, and the answer reflects that id
-
lovetox
you posting the answer
-
allie
maybe firefox is getting confused here. let me try to rerun it all. that came from the request body of the client.
-
allie
(rather than the response)
-
allie
or it's just me, hell if I know
-
allie
gimme a sec
-
lovetox
and maybe use some paste site
-
allie
https://pastebin.com/JAtYkJC7
-
lovetox
yeah this is wrong
-
lovetox
its missing what affiliation you want to request
-
lovetox
are you sure you can set it somewhere on the stanza?
-
lovetox
<item affiliation='member'/>
-
lovetox
thats how it should look like int the request
-
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.
-
lovetox
it seems you have to create a MUCUserItem and pass it
-
lovetox
and in that object you have to set a MUCAffiliation of type member
-
lovetox
if you want the member list
-
lovetox
and just before you get suprised, member list does not include admins and owner
-
lovetox
you have to request the owner list and admin list for that
-
lovetox
but i would report it as a bug to the project, that the second argument is optional
-
lovetox
this function makes no sense without the second argument
-
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
-
lovetox
yes possible, some servers only allow admins and owners to retrive that list
-
lovetox
create a muc on your own and test again
-
allie
the request includes <item affiliation="member">
-
lovetox
yes then its correct, auth error means you are not allowed
-
lovetox
means you are not an admin or owner in this muc
-
allie
makes sense
-
lovetox
some server allow it some dont
-
allie
so if the room is set where only admins/moderators can see JIDs of members, is that what would prevent it?
-
lovetox
yes then the server should definitly not send you the list
-
allie
so how does a client determine who is in the room?
-
lovetox
read XEP-0045
-
lovetox
short version, you get a presence stanza of everyone who is in the room currently, on join
-
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.
-
allie
thank you for helping me and pointing me in the right direction :)