jdev - 2025-10-11


  1. 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

  2. nicoco

    did you send <active /> before?

  3. nicoco

    and yes, chat messages sent in 1:1 have a resource usually

  4. nicoco

    until we maybe adopt "next gen routing" or something like that (I think there is an experimental XEP software)

  5. 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> ```

  6. luca

    Hmmm. So maybe this message sent without a resource shouldn't actually work?

  7. 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"> ```

  8. 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 ^^)

  9. 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 :)

  10. 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!

  11. 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> ```

  12. nicoco

    I think you don't want to set one in to= though

  13. nicoco

    The XMPP server will do it

  14. nicoco

    and sends to all connected clients

  15. luca

    omg thank you. That makes everything so much easier

  16. 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 />`

  17. lovetox

    Active is enough

  18. lovetox

    You don't need to implement all states

  19. lovetox

    Active and typing should be enough for most people

  20. luca

    All right, thanks!

  21. 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 />`

  22. lovetox

    Should be on every message

    👍 1
  23. luca

    > Should be on every message 👍

  24. 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

  25. 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.

  26. luca

    Yep, got it. Thanks!

    👍 1