jdev - 2022-09-01


  1. lovetox

    is there ever a reason a groupchat sends me a type "chat" message from its bare jid?

  2. pep.

    It wants to talk to you!

  3. pep.

    captcha or stuff like that? :/

  4. lovetox

    but this would not be type "chat"

  5. pep.

    Why not

  6. pep.

    Does it have to happen in the room (even if not broadcasted to the others)

  7. lovetox

    a message not sent in a room is not automatically type chat

  8. lovetox

    there is also type "normal" which is commonly used for everything by a groupchat which is not a broadcasted message

  9. lovetox

    the rfc intends type=chat for human one to one chat sessions

  10. pep.

    Does the RFC define human? (/s)

  11. lovetox

    so i go ahead and assume sending a type=chat message which didnt originate from a human interaction is a violation or at least very bad style

  12. pep.

    Normal will render differently on some apps though no?

  13. pep.

    Wasn't gajim actually that had a different UI for them?

  14. pep.

    Wasn't it gajim actually that had a different UI for them?

  15. lovetox

    in ancient times

  16. lovetox

    currently it does not differentiate between them

  17. pep.

    Ok

  18. lovetox

    one of the biggest problems in XMPP i try to deal with since years is the question when i receive something: What is this JID?

  19. lovetox

    is it a groupchat, a account, a pm, a gateway

  20. pep.

    "disco it"?

  21. Ge0rG

    yeah, keep a FIFO queue of disco-unknown stanzas per JID that will be processed once the disco has been responded to. Also good luck with timeouts.

  22. pep.

    I get that it's not exactly optimal to have to wait a network round-trip to choose the UI

  23. pep.

    But it'll be the most accurate answer you'll be able to get I guess

  24. pep.

    If you can't already deduce from the URI (if it's not just a JID)

  25. Ge0rG

    With MUCs, the naive hope is that you won't receive traffic from a JID you didn't ask before.

  26. Ge0rG

    Except with the super-weird corner case of MUC-PMs

  27. pep.

    "corner case" :P

  28. Ge0rG

    Which is why, a few years ago, I insistet on everbody adding <x muc/> elements into each passed PM

  29. Ge0rG

    pep.: you'll only get unsolicited MUC-PMs as carbons from your own server, which should know better

  30. Ge0rG

    > - A private <message/> from a local user to a MUC participant (sent to a full JID) SHOULD be carbon-copied This is a bummer, of course

  31. MattJ

    lovetox, did you receive such a stanza, or you just want assurance it would never happen?

  32. MattJ

    I'd agree that it seems like something that shouldn't happen

  33. Ge0rG

    type=chat from a MUC bare JID? I'm pretty sure there are captcha solutions doing that, maybe also room mode changes on irc bridges

  34. Ge0rG

    oh no, mode changes from biboumi are type=groupchat from=bare

  35. MattJ

    type=groupchat from=bare is something clients should support

  36. MattJ

    ("because I said so")

  37. MattJ

    It used to be commonly supported in clients, before XEP-0045. We have better ways to convey the information it was previously used for, but it's still handy for announcements and things.

  38. lovetox

    no i did not receive something like that

  39. lovetox

    i just want to determine as early as possible that im not dealing with a groupchat

  40. lovetox

    but seems this is doomed to fail

  41. lovetox

    Ge0rG, your proposal seems not thought trough

  42. lovetox

    seems to invite high complexity not worth it

  43. lovetox

    i would be suprised if anyone implemented such a thing in reality

  44. Ge0rG

    lovetox: surprise!

  45. pep.

    Actually many do

  46. lovetox

    yeah please name the project

  47. lovetox

    i want to look into it

  48. pep.

    It's kinda the only way to distinguish certain payloads

  49. pep.

    poezio for one

  50. lovetox

    just to be sure pep. before i go look

  51. Ge0rG

    lovetox: https://lab.louiz.org/poezio/poezio/-/blob/main/poezio/core/handlers.py#L162-174

  52. lovetox

    im not talking about "disco a jid"

  53. lovetox

    im talking about not processing stanzas, until a disco result is received

  54. Ge0rG

    lovetox: yes, poezio

  55. pep.

    ah

  56. Ge0rG

    it's waiting for the disco to resolve before processing

  57. pep.

    Ah yes

  58. Ge0rG

    I think it will even queue all messages from that JID on the has_identity semaphore.

  59. pep.

    (Ge0rG knows better..)

  60. Ge0rG

    well, that was what one of the developers claimed

  61. Ge0rG

    lovetox: also regardless of what other implementations do, it's the only way to correctly handle the situation.

  62. lovetox

    hm for this particular case, no

  63. lovetox

    the correct way to handle this is, if its not marked as muc pm, drop the message

  64. Ge0rG

    the particular use case is: you receive a message from a JID you don't know

  65. Ge0rG

    lovetox: "drop the message" is almost never the correct solution

  66. lovetox

    seems poezio does this only for carbons

  67. lovetox

    sooo ... what does it do when it receives a muc pm over mam?

  68. pep.

    https://lab.louiz.org/poezio/poezio/-/blob/main/poezio/core/handlers.py#L264-275

  69. pep.

    I'd assume it takes this path

  70. pep.

    MAM messages should be replayed as normal messages I think, with some tweaks

  71. lovetox

    in your link i dont see a disco

  72. pep.

    I don't know this codepath much. I guess there should be one, maybe it's just that we encounter this issue less often and we haven't added it yet?

  73. pep.

    If you want you can try to craft a payload and send to my jid I'll tell you what we do :P

  74. lovetox

    i think we can conclude that there is no general architecture in poezio that says we handle stanzas only after a disco.

  75. lovetox

    i think in xmpp it was never needed to disco a contact

  76. lovetox

    you receive something from a jid, look at the type, and open a chat

  77. lovetox

    you dont care if its a groupchat or normal chat, or a gateway

  78. pep.

    fwiw my comment above was because you asked how to know what the jid refers to

  79. pep.

    Sure there are cases you don't really care and you display a generic tab

  80. lovetox

    yes, and that seem to be my fault, i thought, hey lets write code under the assumption we always know what a JID is

  81. lovetox

    seems the smarter way is, write code that does not care what a JID is

  82. lovetox

    you probably should always write at least 2 xmpp clients

  83. lovetox

    one where you learn everything that does not work, and one where you do it right :D

  84. flow

    they say the same things about building a house

  85. lovetox

    maybe we should write such a "Falsehoods XMPP developers believe" article

  86. emus

    lovetox: If that's meant serious I would support it :-)

  87. flow

    we should also try to improve the situation when developing new protocols

  88. lovetox

    did any one ever think about just droping private message altogether

  89. lovetox

    is it such an essential feature?

  90. lovetox

    like could we live without it

  91. lovetox

    does any of the other big messengers has this? whatsapp, telegram, signal, matrix?

  92. pep.

    I'm not sure Gajim could live without it. But something like Snikket definitely could

  93. MattJ

    The problem is that XMPP 1) has public channels and 2) tries to keep participant identitifiers hidden in such channels

  94. MattJ

    Pretty much all other platforms either don't do public channels, or don't hide identifiers

  95. MattJ

    But in this context only are MUC PMs useful. But it's not impossible to find a better alternative at the protocol level.

  96. lovetox

    i guess its half ok now with everyone adding the identifier that its a muc pm

  97. lovetox

    it was total insanity before

  98. lovetox

    the problem is also that i nowhere care about resources anymore

  99. lovetox

    like for a normal chat message, i cast it to bare, i dont save the resource or do anything with it

  100. lovetox

    aynway other topic

  101. lovetox

    corrections, if i correct a message, then it replaces the other one

  102. lovetox

    how does this work with stuff like receipts and chat markers

  103. lovetox

    say i send a message, and then i correct it

  104. lovetox

    do i expect to get a receipt/chatmarker with the message id for the correction?

  105. lovetox

    or with the message id from the original message?

  106. adx

    is there some mechanism that allows MAM queries to be handled from some other entity? so far i only found xep-0442, but it doesn't seem to be implemented anywhere