jdev - 2020-03-27


  1. Jeybe

    To check supported xeps on a specific server one needs to be logged in, correct?

  2. flow

    Jeybe, depends, simply querying the disco#info of the server's address may already reveal most XEPs

  3. flow

    but obviously not the ones that are only exposed to users of this service

  4. Jeybe

    To mention, I'm completely new to XMPP development (and so the conrecte XMPP and XEP specs) and mostly new to development in general. The XEPs I'd like to check are the ones from the Compliance Suite

  5. flow

    Jeybe, well you could simply get the source code of the compliance checker and look how the checker does it

  6. Ge0rG

    Jeybe: some relevant features like Push and MAM are probably only visible on your own account JID, not on the server JID

  7. Ge0rG

    so yes, you need to have an account

  8. Jeybe

    Ok thx

  9. Jeybe

    Makes sense, as for the tester on compliance.conversations.im also needs account credentials

  10. Ge0rG

    the code behind is https://github.com/iNPUTmice/caas

  11. flow

    thats why I am in favor of stuffing those features also in the disco#info response of the service's address: you don't need to have an account to check how widespread an xep/feature is implemented

  12. pep.

    left: `"<root xmlns=\"root_ns\" a=\"b\" xml:lang=\"en\">meow<child c=\"d\"/><child xmlns:ns0=\"child_ns\" d=\"e\" xml:lang=\"fr\"/>nya</root>"` right: `"<root xmlns=\"root_ns\" a=\"b\" xml:lang=\"en\">meow<child c=\"d\"/><child xmlns=\"child_ns\" d=\"e\" xml:lang=\"fr\"/>nya</root>"`'

  13. pep.

    People doing xml properly in their stack, what version would use the less bytes in the general case?

  14. pep.

    Here for sure it's the right one, but in XMPP it's quite common to reuse jabber:client right

  15. pep.

    So I'd rather not shadow it

  16. flow

    to

  17. flow

    many

  18. flow

    quotes

  19. pep.

    yeah sorry, that's the output of my tests :)

  20. flow

    pep this is about XML serialization, right?

  21. pep.

    yes

  22. flow

    I think I would simply use the prefix if it already exists, otherwise not

  23. pep.

    left: `#"<root xmlns="root_ns" a="b" xml:lang="en">meow<child c="d"/><child xmlns:ns0="child_ns" d="e" xml:lang="fr"/>nya</root>"#` right: `#"<root xmlns="root_ns" a="b" xml:lang="en">meow<child c="d"/><child xmlns="child_ns" d="e" xml:lang="fr"/>nya</root>"#`'

  24. pep.

    here, without the escaping

  25. pep.

    flow, not what I'm asking

  26. pep.

    or maybe with this you mean I shouldn't shadow

  27. pep.

    and prefer the left version

  28. flow

    where is something shadowed in the left/right examples you showed?

  29. pep.

    In the right example the child xmlns shadows root's

  30. pep.

    the second child

  31. pep.

    Which means if this child has descendants, I won't be able to reuse root's ns without redeclaring it

  32. flow

    right

  33. flow

    but in xmpp we tend to not re-use jabber:client once an extension element namespace has been declared

  34. flow

    <forwarded/> being one prominent exception

  35. Link Mauve

    An exception would be forwarded or MIX.

  36. flow

    ahh MIX, really?

  37. Link Mauve

    MIX-PRESENCE IIRC.

  38. flow

    cause its in pubsub potentially

  39. flow

    anyway, I am not sure what you are asking, or if there is a generic answer to your question

  40. Link Mauve

    Presence in PubSub! \o/ <items node='urn:xmpp:mix:nodes:presence'> <item id='123456#coven@mix.shakespeare.example/UUID-x4r/2491'> <presence xmlns='jabber:client'> <mix xmlns='urn:xmpp:presence:0'> <jid>hecate@shakespeare.example/UUID-x4r/2491</jid> <nick>thirdwitch</jid> </mix> <show>dnd</show> <status>Making a Brew</status> </presence> </item> </items>

  41. flow

    but if your codebase is so far feature complete that you think about saving bytes… ;)

  42. pep.

    flow, no I'm just curious, I have to make a choice :P

  43. Link Mauve

    pep., what I’d do would be to let the user declare the prefixes they want on the root <stream:stream>, if XEP-0044 negociated it’s allowed, and only use prefixed elements if their namespace has been defined there.

  44. pep.

    My implementation does left at the moment

  45. pep.

    But our tests do right

  46. flow

    pep: smack would (potentially) prefix presence in this case

  47. flow

    with the rule I mentioned before

  48. pep.

    let me test on real data

  49. pep.

    Link Mauve, minidom doesn't have the knowledge of "stream header" or not

  50. Link Mauve

    pep., yeah, so it should be handled at another layer, which is why I said “let the user”.

  51. pep.

    Sure, with the new API I let the user define custom prefixes

  52. pep.

    <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"><message><body/><replace xmlns:ns0="urn:xmpp:message-correct:0"/></message></stream:stream>

  53. pep.

    hmm, ns0 is indeed useless here.

  54. pep.

    And message and body just reuse the default ns

  55. pep.

    wait, this is not valid. it should be ns0:replace