-
luca
Hi, I'd like to implement chatstates in a component, but I am having a bit of trouble getting my head around XMPP and/or XEP-0085. In particular sending state in "direct messages" (not MUCs) I tried sending the following ```xml <message from='luca2%localhost@biboumi.localhost' to='luca@localhost' type='chat'> <composing xmlns='http://jabber.org/protocol/chatstates'/> </message> ``` And it shows up in gajim as the following ```xml <message xmlns="jabber:client" to="luca@localhost" type="chat" xml:lang="en" from="luca2%localhost@biboumi.localhost"> <composing xmlns="http://jabber.org/protocol/chatstates" /> </message> ``` Yet no typing notification shows up (and I highly doubt this is a gajim issue) Reading the examples on the XEP-0085 page what I am doing looks pretty damn similar https://xmpp.org/extensions/xep-0085.html#example-basic The only difference I can tell is that the examples show a resource as well. Is that important? That doesn't seem to be how normal private messages are sent between users
-
nicoco
did you send <active /> before?
-
nicoco
and yes, chat messages sent in 1:1 have a resource usually
-
nicoco
until we maybe adopt "next gen routing" or something like that (I think there is an experimental XEP software)
-
luca
I have sent this before, which I believe should count ```xml <message from='luca2%localhost@biboumi.localhost' to='luca@localhost' type='chat'> <active xmlns='http://jabber.org/protocol/chatstates'/> <body>Hello world</body> </message> ```
-
luca
Hmmm. So maybe this message sent without a resource shouldn't actually work?
-
nicoco
> that's the misunderstanding, which I also find totally unintuitive: > > (assume namespace rdf is defined above) > > 1: <rdf:bla rdf:about='foo'/> > 2: <rdf:bla about='foo'/> > > For #1 the about attribute has the namespace rdf, for #2 it's got no namespace damn, that means that slidge is illegal then! <https://codeberg.org/slidge/slidge/src/branch/main/tests/test_stanza_link_preview.py#L21> 👮🚨 ```xml <Description xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" about="https://the.link.example.com/what-was-linked-to"> ``` ↺
-
nicoco
> Hmmm. So maybe this message sent without a resource shouldn't actually work? I wouldn't be surprised if gajim just ditch those, yes (but you'd have to check through the code or maybe ask lovetox to be sure ^^) ↺
-
nicoco
Anyway, I develop a gateway component and for a lot of stuff to work in most client, I just added a resource to all "puppet JIDs", it's just easier this way :)
-
luca
This is actually gateway -> xmpp, so I should be able to get a real resource from somewhere. But good tip to give the puppets some resource as well!
-
luca
Oh I see, I need a resource for both "from" and "to". So this works as expected ```xml <message from='luca2%localhost@biboumi.localhost/luca2' to='luca@localhost/gajim.25W09DPD' type='chat'> <paused xmlns='http://jabber.org/protocol/chatstates'/> </message> ```
-
nicoco
I think you don't want to set one in to= though
-
nicoco
The XMPP server will do it
-
nicoco
and sends to all connected clients
-
luca
omg thank you. That makes everything so much easier
-
luca
and if I am reading the stuff correctly sending an `<active />` with the message should stop the typing notification, right? Or should I also send something like `<gone />`
-
lovetox
Active is enough
-
lovetox
You don't need to implement all states
-
lovetox
Active and typing should be enough for most people
-
luca
All right, thanks!
-
luca
And one more thing, is it bad to send `<active />` with every `<body />` message? Or should I do this the proper hand-shakey way where only the first message gets `<active />`
-
lovetox
Should be on every message
👍 1 -
luca
> Should be on every message 👍 ↺
-
moparisthebest
>> that's the misunderstanding, which I also find totally unintuitive: >> >> (assume namespace rdf is defined above) >> >> 1: <rdf:bla rdf:about='foo'/> >> 2: <rdf:bla about='foo'/> >> >> For #1 the about attribute has the namespace rdf, for #2 it's got no namespace > damn, that means that slidge is illegal then! <https://codeberg.org/slidge/slidge/src/branch/main/tests/test_stanza_link_preview.py#L21> 👮🚨 > ```xml > <Description xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > about="https://the.link.example.com/what-was-linked-to"> > ``` the XML police have been dispatched to your location ↺
-
nicoco
> omg thank you. That makes everything so much easier I should have added that this is only true for 1:1 direct messages. For MUCs you need to track the resources, and send messages to full JIDs. ↺
-
luca
Yep, got it. Thanks!
👍 1