jdev - 2021-11-05


  1. lovetox

    c14n do i need that in xmpp? do i need to read up on thatß

  2. lovetox

    c14n do i need that in xmpp? do i need to read up on that?

  3. flow

    I don't think so, although discussions around canonicalization come up once in a while

  4. flow

    but with stanza routing hops may injecting new elements, modifying or deleted existing ones, it's probably unrealistic that c14n is in any sensible in xmpp

  5. lovetox

    thanks

  6. lovetox

    hm

  7. lovetox

    how does xml:lang inheritence work with websocket?

  8. lovetox

    as every websocket frame is its own document i guess not at all

  9. lovetox

    so am i supposed to add xml:lang to every message

  10. lovetox

    oh wow yes indeed thats how it works

  11. lovetox

    that breaks everything, now i dont even have a document, just lose elementes ...

  12. Zash

    Dould have been nice do define a websocket variant without that framing hack

  13. MattJ

    Yet people rejoiced at finally having framing, at the time

  14. MattJ

    and consider streaming the hack :)

  15. lovetox

    its just makes it really hard to abstract over these two different streaming methods

  16. lovetox

    ..

  17. flow

    maybe that's just another argument to not view the XMPP connection of an endless stream of an XML document, but instead a stream of individual XML elements: the XMPP top level stream elements

  18. Zash

    Hrrrrrrrr

  19. Kev

    flow: That's more or less what we do in M-Link, turn the document stream into a stream of top level elements. I imagine most things do the same.

  20. MattJ

    Yes

  21. flow

    maybe that's just another argument to not view the XMPP connection as an endless stream of an XML document, but instead a stream of individual XML elements: the XMPP top level stream elements

  22. lovetox

    em ... im not even sure how to do this

  23. lovetox

    hm

  24. lovetox

    but then i lose all the nice things the parser does for me

  25. lovetox

    for example i need then to add jabber:client to all incoming stanzas

  26. lovetox

    i need to do the same with xml:lang

  27. lovetox

    if i treat it as a document, the xml parser does this all for me

  28. Zash

    Maybe you can do like what Prosody does, rewrite the websocket stream into an xmpp stream and parse that as usual

  29. lovetox

    yes, i plan to add a dummy <root> element

  30. lovetox

    i can even do <root xml:lang='en'>

  31. lovetox

    hm no i cant

  32. lovetox

    every stanza needs to be its own document ..

  33. lovetox

    ok lets leave websolcket broken for now :D

  34. Zash

    That does not sound like what prosody does.

  35. flow

    lovetox, Smack wraps every top-level stream element in a synthesized <stream/> with the relevant attributes set. Since it's only a handful of attributes, it's pretty easy

  36. flow

    of course, things get a little bit more complicated if you consider e.g. namespace declarations in <stream/>, but that should also be no show stopper

  37. Zash

    Unless you rewrite `<open/>` into `<stream:stream>` and then feed everything into a normal stream parser

  38. flow

    Zash, what happens then?

  39. Zash

    You can pretend it's a normal XMPP stream and parse it as such