jdev - 2021-11-28

  1. Martin


  2. Martin just answered a "new" mail from juser and realized later that it was from december 2020.

  3. Martin

    Is the date setting on the sending site wrong or did juser take almost one year to deliver that message?

  4. Martin


  5. defanor

    FWIW, "Received" headers usually contain timestamps, so you may be able to track when it went where, according to the servers adding those headers, and compare to user-set "Date".

  6. defanor

    I happened to receive a reply to a message from April just yesterday, maybe it's the delayed message delivery day.

  7. Zash

    Perhaps it was triggered by the configuration change mentioned in https://mail.jabber.org/pipermail/council/2021-November/004520.html

  8. Martin

    > Received: from NAM12-DM6-obe.outbound.protection.outlook.com > (mail-dm6nam12olkn2074.outbound.protection.outlook.com []) > by atlas.jabber.org (Postfix) with ESMTPS id BBAF089D > for <juser@jabber.org>; Tue, 29 Dec 2020 19:15:31 +0000 (UTC)

  9. lovetox

    i find it really ugly

  10. lovetox

    that resource binding is done via IQ

  11. Zash


  12. lovetox

    why though, i mean there was probably a history or story behind this

  13. Zash

    Welcome to the sensible camp! Let's give angry stares to those who think everything in session startup should be iq stanzas 😉

  14. Zash

    lovetox, behold this horror: https://xmpp.org/extensions/xep-0078.html

  15. Zash

    I remember doing that with telnet 900 years ago

  16. lovetox

    but it makes no sense, reading the rfc, its only nonzas all the way, and then suddenly they start with stanzas BEFORE WE HAVE A JID :D

  17. Zash

    I think "nonzas" were invented at the time of IETF standardization

  18. lovetox

    title is enough for me, to not read that

  19. Zash

    Scroll down to https://xmpp.org/extensions/xep-0078.html#example-3 and cry

  20. Zash

    Tho it was easier to type that into telnet than doing SCRAM in your head 😉

  21. Zash

    or even PLAIN

  22. Zash

    lovetox, do you have a moment to talk about our lord and savior, https://xmpp.org/extensions/xep-0386.html ? ;)

  23. Zash

    and https://xmpp.org/extensions/xep-0388.html

  24. Zash

    and https://xmpp.org/extensions/xep-0389.html

  25. Zash

    the holy trinity of XMPP 2.0 connection establishing

  26. lovetox

    yes, im interested in that, is there some working support in prosody for that?

  27. Zash

    I had a prototype / WIP somewhere

  28. Zash

    Hopefully there'll be more time to work on that after Prosody 0.12 gets out the door.

  29. lovetox

    also something very ugly

  30. lovetox

    every stanza has a type attribute with a value

  31. lovetox

    except presence, it can just be absent

  32. Zash

    message too

  33. Zash

    only iq is strict

  34. lovetox

    no with message its just an optimization

  35. lovetox

    you can leave it out but that means "normal"

  36. lovetox

    for presence there is no default

  37. Zash

    Only having to send `<presence/>` to go online is nice tho.

  38. lovetox

    makes writing stanza handlers fun, now you need to add code for the single case, where you want to match on the absence of an attribute

  39. lovetox

    Zash, no problem with that, just assign a default like with message

  40. lovetox

    presence type=normal

  41. lovetox

    or something

  42. Zash

    how about 'available' to mirror 'unavailable' ?

  43. Zash

    and then hide that in abstractions so it serializes out to None or whathaveyou

  44. jonas’

    enums! :)

  45. lovetox

    actually i do that, with show

  46. jonas’

    and that broke everything?

  47. Zash


  48. lovetox

    no works quite well

  49. lovetox

    i simply have a added, Show.AVAILABLE

  50. lovetox

    but yeah this is the next ugly thing with presence

  51. lovetox

    you commnicate your state with show

  52. lovetox

    but not if you are available

  53. lovetox

    then its absent

  54. lovetox

    now you need everytime to check 2 things, actually type must be absent AND show must be absent

  55. lovetox

    and no problem with optimizations on the stream with default values etc

  56. lovetox

    but to have nothing, puts library developers in the situation to add stuff thats not in the standard to make things sane

  57. Zash

    Abstractions gonna abstract

  58. lovetox

    i really just wonder, that rfc was written over some weeks or months whatever, some inital idea and it was like Presence: Ok most things can be absent, we dont need defaults, just the absence is enough IQ: Nothing is allowed to be absent Message: Lets allow something to be absent, but we define a default

  59. Zash

    The initial RFCs were written years after Jabber was already a thing

  60. lovetox

    ok so this was like some thing that needed to be backwards compatible from the start

  61. lovetox


  62. Zash

    Jabber was launched in 1999, the IETF standardization happened around 2002-2005 I think (I wasn't involved in any of this back then)

  63. Zash

    Historical Reasons, yes 🙂

  64. lovetox

    i found something debatable

  65. lovetox

    prosody answers a bind request with

  66. lovetox

    <iq type='result' id='myid'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>lovetox@jabber.fr/test</jid></bind></iq>

  67. lovetox

    no from on the jid would mean this iq is from the user account

  68. lovetox

    no from on the stanza would mean this iq is from the user account

  69. Zash

    I've found it safest for my own sanity to not think of those as actual iq stanzas

  70. lovetox

    should it not be instead from the server? so from=jabber.fr

  71. Zash

    Instead, pretend that's a nonza that just happens to be called <iq xmlns="jabber:client">

  72. Zash

    to and from are only allowed on real stanzas

  73. Zash

    before you've bound a resource, those don't even make sense

  74. Zash

    Prosody even treats it as a nonza

  75. lovetox

    rfc does also not include a from in its example for bind

  76. Zash

    Oh, there it is

  77. Zash


  78. lovetox

    it gets more funny if you consider error cases while binding

  79. lovetox

    in iq errors the original query is not mandatory included

  80. lovetox

    then you dont even have the bind namespace

  81. lovetox

    but i guess the iq stanza id ..

  82. jonas’

    also there can be no other stanza in flight at that point

  83. lovetox

    i hate to break the promise to the application that every iq has a from address

  84. jonas’

    then don't

  85. lovetox

    only because of this one case ...

  86. jonas’

    treat it as a nonza

  87. lovetox

    thats hard

  88. lovetox

    then i need to make an exception at the parser level

  89. lovetox

    but i guess i could do this

  90. lovetox

    so it does not end up as a type IQ

  91. Zash

    in prosody nothing is a stanza until after resource binding

  92. Zash

    tho that's handled above the parser, nearer the routing

  93. lovetox

    right now the parser translates parsed elements based on tag and namespace to respective classes

  94. lovetox

    and later i dispatch depending on the type

  95. lovetox

    jonas’, i dont know how much you have typed your lib, but such things are not just a problem because you have to create some exception in your code somewhere

  96. lovetox

    its your IQ object now returns on get_from() suddenly None or JID

  97. jonas’

    lovetox, I register the stream-level elements dynamically

  98. jonas’

    that's why it's not a problem

  99. lovetox

    which is incredibly ugly for applications

  100. lovetox

    becuse they now get lots of typing errors, if they dont always check for None

  101. jonas’

    and from gets rewritten early in the code which knows about stanzas

  102. jonas’

    to be consistent

  103. lovetox

    ok i will try to make it into a weird iq nonza :D

  104. lovetox

    lets see how that works out

  105. Zash

    okay, I made an https://modules.prosody.im/mod_bind2.html to go with https://modules.prosody.im/mod_sasl2.html

  106. Zash

    ... consisting to 80% of TODOs 🙂

  107. thomaslewis

    Does it at least function semi-properly?

  108. Zash

    thomaslewis, you tell me!

  109. thomaslewis

    ejabberd here, so...

  110. thomaslewis needs to get back to writing IdleRPG for XMPP at some point...