jdev - 2025-05-11


  1. halscode

    Something great (frustrating) is that I have no idea if I'm missing chat history in any MUC I'm in, while my computer isn't on. My phone is connected so it would just send it there, but now I don't have that history on my computer!

  2. singpolyma

    MUC history you get when joining and/or doing a sync. It's not tied to being joined?

  3. halscode

    Haven't the slightest idea, no way for me as an end-user to tell. And plus Gajim didn't show this room's history but it got future@joinjabber.org's easily, and Monocles on my phone got both easy, faster than Gajim did even, when I first joined both of them. Gotta love the XMPP inconsistency

  4. lovetox

    You are always missing messages as this room exists since a decade, do you want to download a million messages?

  5. bodqhrohro

    I implement upgrading PMs to MUCs on the same (virtual) JID and vice versa. Tkabber, Dino and another.im survive it rather well, but Gajim fails: ``` ValueError: Trying to add GroupchatContact -566866516@zg.94.177.207.80, but contact already exists as -566866516@zg.94.177.207.80 (94.177.207.80) (in roster: False) ``` Even unsubscribing manually doesn't help, as this "roster: False" seems to mean that just a chat exists in some internal structures, only deleting it completely would help perhaps. Is this behaviour correct? I did already wonder if this was a good idea at all… no big problem to make a different JID space for MUCs, I just wanted to make the migration as seamless as possible.

  6. lovetox

    You probably need to delete the cahce

  7. lovetox

    You probably need to delete the cache

  8. lovetox

    .cache/gajim

  9. lovetox

    And yeah gajim does not react well if you add frozpchats to the roster

  10. lovetox

    And yeah gajim does not react well if you add groupchats to the roster

  11. lovetox

    Very bad idea btw

  12. lovetox

    A jid should always point to the same thing

  13. lovetox

    Im not sure what you mean by upgrading a jid

  14. doge

    > Haven't the slightest idea, no way for me as an end-user to tell. And plus Gajim didn't show this room's history but it got future@joinjabber.org's easily, and Monocles on my phone got both easy, faster than Gajim did even, when I first joined both of them. Gotta love the XMPP inconsistency It's an extensible protocol, not a consistent or reliable one. For those would be CMPP and RMPP

    😜 1
  15. Menel

    >> Haven't the slightest idea, no way for me as an end-user to tell. And plus Gajim didn't show this room's history but it got future@joinjabber.org's easily, and Monocles on my phone got both easy, faster than Gajim did even, when I first joined both of them. Gotta love the XMPP inconsistency > It's an extensible protocol, not a consistent or reliable one. For those would be CMPP and RMPP 😜

  16. lovetox

    doge: this has nothing to do with reliability, user is just confused that different clients provide different capabilities of querying old messages

  17. doge

    You could say that about any sloppy software. "Windows BSODing has nothing to do with reliability, user is just confused that different operating systems provide different capabilities of running continuously"

  18. lovetox

    No not really. Only because a client does not meet the expectations of a user does not make a protocol unreliable

  19. lovetox

    It maybe makes the client unreliable

  20. Menel

    The extensibility can make it as relaiable as one wants after all 😇

  21. doge

    halscode was talking about inconsistency. Consistency I think is one of those things that extensibility cannot achieve and moreover tends to harm.

  22. doge

    But then reliability also depends on consistency to a degree I think. "Can I rely on my contact's phone to show them effectively the same thing I see?" - even if all xmpp clients perfectly did their job but in their own way, supporting different extensions, the answer would still be no, because you don't know what your contact's phone supports. E.g. you wouldn't know if he sees your pfps, because he may have a client that doesn't support it. And as of right now, people including me randomly don't see other people's pfps even on clients that support pfps

  23. Martin

    What is pfps?

  24. moparisthebest

    Avatars

  25. Martin

    OK. Thanks. How do you turn avatars into that acronym?

  26. raucao

    i guess we should ideally be able to trust that messaging clients agree on and implement everything documented here: https://docs.modernxmpp.org/client/protocol/

  27. raucao

    so it's not an entirely arbitrary set of features

  28. jonas’

    Martin, "ProFile PictureS"

  29. Martin

    Thanks.

  30. singpolyma

    > Haven't the slightest idea, no way for me as an end-user to tell. And plus Gajim didn't show this room's history but it got future@joinjabber.org's easily, and Monocles on my phone got both easy, faster than Gajim did even, when I first joined both of them. Gotta love the XMPP inconsistency So you're saying you joined this room with gajim and got zero recent messages at all on first join?

  31. lovetox

    Gajim requests only 24 hours on first join

  32. lovetox

    In slow channels this could be zero

  33. singpolyma

    We're we really silent in here for 24 hours? I miss the old room history API where the room would just send you whatever made sense on first join...

  34. Menel

    Yes, this ^ and Dino not requesting something from before the fist join often gets confusion by users not used to this

  35. lovetox

    This is could be better on protocol level but there is no way to request an amount of messages with user content

  36. lovetox

    If I request 100 messages, it could still mean zero as chat states are also messages

  37. Menel

    Hm. But the client could count how many have a body and stop requesting after it got enough with one?

  38. lovetox

    Yes, but this is of course more complex to implement

  39. Link Mauve

    “03:02:05 1 days, 10 hours passed…” yes, we were silent for over 24h.

  40. halscode

    > So you're saying you joined this room with gajim and got zero recent messages at all on first join? that's correct. It did try to, it spun on something along the lines of "getting recent messages" for maybe 30 seconds before giving up.

  41. halscode

    > Gajim requests only 24 hours on first join tbh a better implementation would be by number of messages, i.e. 100. Could do "or past day, whichever is more". Not sure if MAM-MUC supports that though

  42. halscode

    I think for Spades, when I get to MUCs, I want to try to do infinite backscrolling, where when you scroll to the top it loads more messages (20 or 50 at a time, possibly depending on if the connection is metered). And it would also do this on first join of an MUC of course, possibly with even more (i.e. 100). This would make good use of XEP-0059

  43. theTedd

    Note: there is usually a limit to how much MUC history is a available, and you'll want to dip into your locally saved history where available

    👍 1
  44. theTedd

    Note: there is usually a limit to how much MUC history is available, and you'll want to dip into your locally saved history where available

  45. halscode

    > halscode was talking about inconsistency. Consistency I think is one of those things that extensibility cannot achieve and moreover tends to harm. Most of the inconsistency in XMPP is due to competing extension standards (profiles, avatars, file attachments...), and some of it is due to widely differing implementations. A common SDK like DeltaChat has can actually mitigate most of these

  46. badrihippo

    Hey speaking of which, where do I find the Snikket SDK? I'd forgotten it existed, but it could be useful now as I'm thinking of (experimentally) developing an XMPP-based (non-chat) app

  47. singpolyma

    > I think for Spades, when I get to MUCs, I want to try to do infinite backscrolling, where when you scroll to the top it loads more messages (20 or 50 at a time, possibly depending on if the connection is metered). And it would also do this on first join of an MUC of course, possibly with even more (i.e. 100). This would make good use of XEP-0059 Yes my SDK does this so even if initial sync of 3 days got nothing a would get last page when you look at it. But this discussion has me thinking I should switch from 3 days to 1000 items on initial join

  48. singpolyma

    badrihippo: things are in flux but we're in process of moving it to https://borogove.dev

  49. theTedd

    Obviously it's simpler to grab a huge tranche, but progressively fetching small portions until you have 'enough' would be preferable and allow for better responsiveness

  50. theTedd

    Then you're also not fetching days of messages you already have stored locally anyway

  51. singpolyma

    If you have anything stored locally anyway this isn't relevant

  52. singpolyma

    We're talking about first join

  53. singpolyma

    As soon as you have local history you can fetch since then

  54. Zash

    Or before, if the user scrolls up

  55. singpolyma

    Right

  56. halscode

    Isn't it still possible to have "holes" in the middle? Maybe you have message history saved locally from November through January, but you haven't logged in since then and now it's May. So when you log in in May, maybe you don't want to get the whole message history in between, that could be a lot of messages. So as you scroll back, you'll see your new messages from May or April, then you might need to look up messages between May or April and January via MAM, and then you have some history again maybe, and then you need to fetch more from before November... it's pretty complex but it's worth figuring out

  57. theTedd

    Yes, holes are a problem, so it's best if your datastore can represent them, and then you can fill them as needed

  58. singpolyma

    Yes if you choose to have holes that's a whole different kind of problem and set of solutions

  59. doge

    > Isn't it still possible to have "holes" in the middle? Maybe you have message history saved locally from November through January, but you haven't logged in since then and now it's May. So when you log in in May, maybe you don't want to get the whole message history in between, that could be a lot of messages. So as you scroll back, you'll see your new messages from May or April, then you might need to look up messages between May or April and January via MAM, and then you have some history again maybe, and then you need to fetch more from before November... it's pretty complex but it's worth figuring out Yeah that's what I stumbled upon when trying to implement my own client.

  60. bodqhrohro

    > 2025-05-11T07:13:36Z - lovetox: > Im not sure what you mean by upgrading a jid Groupchats were simulated via PM previously, now I rework them to work via MUC.

  61. doge

    >> 2025-05-11T07:13:36Z - lovetox: >> Im not sure what you mean by upgrading a jid > Groupchats were simulated via PM previously, now I rework them to work via MUC. The what

  62. doge

    Oh you mean like you have your own corporate system in place or smth?..

  63. bodqhrohro

    > 2025-05-11T16:33:09Z - doge: > The what The transport. I don't know why was it decided to be done so, TBH. But it definitely has its benefits. F.e., messages are delivered for sure if there is a subscription, while joining all the existing MUCs via bookmarks might be unreliable depending on a client. Also, no memberlist and no excessive traffic for it. I'm going to keep this legacy system too during the next major release at least.

  64. doge

    What transport is that

  65. doge

    Vk or mailru? Love that ancient avatar

  66. bodqhrohro

    > 2025-05-11T16:49:27Z - doge: > What transport is that telegabber

  67. bodqhrohro

    > 2025-05-11T16:49:44Z - doge: > Vk or mailru? Love that ancient avatar The meaning of the avatar is quite opposite lol.

  68. lovetox

    but what did you do with PMs ? i dont understand what it means to simulate groupchat with PM

  69. bodqhrohro

    > 2025-05-11T18:04:28Z - lovetox: > but what did you do with PMs ? i dont understand what it means to simulate groupchat with PM Just sending messages from all the members with fake text headers. Like this: ``` 06/01/24 | 19:58:06 TDLib chat: ⬅ 139874795520 | Hi, 未来 (@anl2018) | reply: 139872698368 | - Sobhan (@SobhanCU) | 不。 what? 06/01/24 | 19:58:31 TDLib chat: ⬅ 139875844096 | - Sobhan (@SobhanCU) | reply: 139874795520 | Hi, 未来 (@anl2018) | what? 'no.' 06/01/24 | 20:00:02 TDLib chat: ⬅ 139876892672 | Hi, 未来 (@anl2018) 兄弟,你来搞笑的吧! ```

  70. bodqhrohro

    MUCs will provide a more native integration, especially for OOB messages where there is no room to put some text (that's a huge downside of OOB actually).

  71. lovetox

    is the difference between a PM and normal groupchat message not just the "type" attribute? both come from a full jid

  72. qy

    im glad more people are making clients lately

  73. qy

    maybe we'll get some good ones

  74. lovetox

    i dont think gajim should have a problem with it, of course the message would need the <x> element, otherwise gajim would not discover that this is a PM

  75. lovetox

    then the bare jid gets treated as an account, if later conflicting information arises that would somehow make the same bare jid suddenly a MUC stuff breaks

  76. bodqhrohro

    > 2025-05-11T18:24:18Z - lovetox: > is the difference between a PM and normal groupchat message not just the "type" attribute? both come from a full jid There's indeed no huge difference. Just the type, and the resource (the outgoing resource was always the same before). Though AFAIR, the MUC spec mandates that when a messages comes from a resource, a presence about the following member should come first, otherwise the message should be rejected.

  77. lovetox

    but this is not necessary for a PM

  78. bodqhrohro

    > 2025-05-11T18:30:12Z - lovetox: > then the bare jid gets treated as an account, if later conflicting information arises that would somehow make the same bare jid suddenly a MUC stuff breaks Yup, currently `_get_contact` returns the non-groupchat contact despite the `groupchat=True` argument, and the code breaks further because it attempts to access groupchat-specific properties. Yet again, I didn't upgrade it to the latest version yet.

  79. bodqhrohro

    > 2025-05-11T18:33:34Z - lovetox: > but this is not necessary for a PM Are you talking about possible MUC-to-PM downgrades?

  80. lovetox

    a PM is a message with type=chat and <x xmlns='http://jabber.org/protocol/muc#user' />

  81. lovetox

    everything else is *not* a pm

  82. bodqhrohro

    > 2025-05-11T18:34:17Z - lovetox: > a PM is a message with type=chat and <x xmlns='http://jabber.org/protocol/muc#user' /> Uh, you mean MUC PM then.

  83. lovetox

    what did you mean?

  84. bodqhrohro

    What is plain 1-to-1 messaging then?

  85. lovetox

    a chat messge

  86. bodqhrohro

    Okay then.

  87. lovetox

    private message has special meaning in XMPP and always means MUC PM

  88. bodqhrohro

    I just think "chat" might be also confusing because it might mean group chats as well.

  89. lovetox

    no, usually you name the message after the type attribute

  90. lovetox

    type=chat -> chat message type= groupchat -> groupchat message

  91. lovetox

    pm is a special case of a type=chat message

  92. lovetox

    anyway, im more confused now

  93. bodqhrohro

    Nevermind anyway, I should make MUCs on a separate JID as a safety measure. Even though such an upgrade works well in some clients, there might be unpredictable consequences in arbitrary legacy ones. Not needing a separate domain is lucky enough already.

  94. bodqhrohro

    It would just complicate working with JIDs a bit more (rn, it's assumed everywhere they can be easily converted to numbers and back everywhere.

  95. bodqhrohro

    It would just complicate working with JIDs a bit more (rn, it's assumed everywhere they can be easily converted to numbers and back everywhere).

  96. lovetox

    but anyway, i made a bad design decision once when assuming groupchats are not in the peoples roster

  97. halscode

    xmpp terminology != traditional terminology

  98. lovetox

    since then it always breaks when some client for whatever reason adds a groupchat to the roster

  99. lovetox

    halscode, i agree with you in most cases, but know your audiance, this is a xmpp developer chat

  100. halscode

    yeah ik, just pointing out that it's not the same. so it's gonna be confusing

  101. halscode

    > type=chat -> chat message > type= groupchat -> groupchat message as far as xmpp goes, for instance, this is right and a good way to differentiate, because the subtle difference is important

  102. halscode

    it works okay for end-users too as long as they're delineated in separate chats. but PMs get a little confusing (and on a side note, this has inspired me to call them "whispers" in my client to convey that, generally nobody else is going to see it but a sneaky eavesdropper still might, as opposed to a "private message" which is misleading or a "personal message" or even "direct message" which is confusing and doesn't differentiate enough from regular 1-to-1 chats)

  103. halscode

    it works okay for end-users too as long as they're delineated in separate chats. but PMs get a little confusing (and on a side note, this has inspired me to call them "whispers" in my client to convey that, generally nobody else is going to see it but a sneaky eavesdropper still might, as opposed to a "private message" which is misleading or a "personal message" or even "direct message" which is confusing and doesn't differentiate enough from regular 1-to-1 chats. Especially as a "whisper" might be done in a public place to not share something with everyone there)

  104. halscode

    Oh something else I just thought of: I'm planning on implementing pinned messages into my client, at some point. It's something my family group chat uses a lot to pin important information like schedules. Is there already an XEP for it or will I need to write one?

  105. doge

    I think those annoying messages I used to see in older gajim versions "xxx set group subject to yyy" are roughly that

  106. lovetox

    halscode, there is no spec to pin messages yet, but you can use the groupchat subject

  107. lovetox

    also you need server support for it to work

  108. lovetox

    thats nothing that you can implement just clientside

  109. Goot the ticklegoblin!

    probably would work more for like "mark as urgent" or something like that

  110. halscode

    It's similar but different. Pinned messages may be somewhat less important but something you want to reference easily. Occasionally it's also useful in direct messages

  111. edhelas

    halscode what is your client you're working on ? :) Curious about it

  112. Goot the ticklegoblin!

    so clients know to treat the message as something to be "pinned"

  113. halscode

    > probably would work more for like "mark as urgent" or something like that see that sounds like something that would change the appearance of the message to emphasize it

  114. halscode

    can I instruct MAM to not expire certain messages?

  115. doge

    halscode: what's your client?

  116. halscode

    > can I instruct MAM to not expire certain messages? nah doesn't seem to support it

  117. doge

    > can I instruct MAM to not expire certain messages? iirc there isn't even currently a way to tell how long mam stores your messages....

  118. halscode

    > halscode: what's your client? I'm using Gajim and Monocles, and I'm making one currently called Spades: https://codeberg.org/spades/spades-flutter (the readme is ancient, I've got to fix that some time this week when I have the time for it)

  119. halscode

    it might be accomplishable with PEP, maybe?

  120. lovetox

    there are many ways to the goal, but all include server side support

  121. halscode

    looking at PEP, it's probably doable that way but only for direct messages, not groupchats

  122. lovetox

    in single chat, you can just make that feature local

  123. lovetox

    though i would not make it as "pinned"

  124. lovetox

    rather i would implement a "mark this message, so i can look it up later" or something

  125. lovetox

    and then have somewhere a screen, that shows you all marked messages

  126. Goot the ticklegoblin!

    flag as urgent

  127. Goot the ticklegoblin!

    something generic like that

  128. halscode

    > rather i would implement a "mark this message, so i can look it up later" or something Kinda like a "starred" message in the Google Messages app

  129. halscode

    Okay for one on one, though for groups it's more difficult

  130. lovetox

    in groupchats you pin the message for everyone

  131. lovetox

    that needs a mechanism to distribute the information to all members, hence you need server support

  132. lovetox

    the subject distribution is that mechanism, we just need to have a spec that we can extend the subject with the message ids

  133. singpolyma

    > private message has special meaning in XMPP and always means MUC PM I'm not sure that's true 😛 but it definitely sometimes means that

  134. Goot the ticklegoblin!

    > that needs a mechanism to distribute the information to all members, hence you need server support it works for like if everyone happens to be on at the same time

  135. Goot the ticklegoblin!

    or always syncs the room history immediately

  136. Goot the ticklegoblin!

    `<my-cool-pin xmlns="tag:my.example,2025-05-11:pin"/>`

  137. Goot the ticklegoblin!

    `<my-cool-pin xmlns="tag:my.example,2025-05-11:pin" id="some-message-id"/>`

  138. doge

    Can a pinned message just be a normal <message/> with some flag saying it's to be displayed as pinned?

  139. Goot the ticklegoblin!

    it'd probably look something like that^

  140. doge

    For example, on Telegram you can even see a history of pinned messages that is you can jump to the previous pinned message.

  141. lovetox

    no thats not how you would do this, the message is not modified

  142. lovetox

    you just attach the message ids you want to pin to the subject for example

  143. lovetox

    if you make it a flag in the message itself this would mean all clients need to download all messages ever to find all pins

  144. lovetox

    further your approach would mean a user needs to know that a messages needs to be pinned, before writing it

  145. lovetox

    also it would mean other persons cannot pin messages, only the person that writes the message initially

  146. Goot the ticklegoblin!

    no yeah that's what the `id="some-message-id"` attribute would do

  147. Goot the ticklegoblin!

    a separate message saything "The referenced message is important and should be shown in a 'pinned' or similar interface"

  148. Goot the ticklegoblin!

    a separate message saying "The referenced message is important and should be shown in a 'pinned' or similar interface"

  149. doge

    From my observation, messages are the most reliable part of XMPP. They are delivered most of the time while even profile pictures randomly disappear for people, nicknames won't change etc.

  150. Goot the ticklegoblin!

    maybe even have like a `prev="some-other-id"` to reference the *previous* pinned message (as known by the sender)

  151. Goot the ticklegoblin!

    > maybe even have like a `prev="some-other-id"` to reference the *previous* pinned message (as known by the sender) that wouldn't work actually thinking about it unless the message was like pinned recently after pinning

  152. Goot the ticklegoblin!

    wouldn't work as like a "click here repeatedly to step through the pins" kinda thing

  153. Goot the ticklegoblin!

    > that wouldn't work actually thinking about it unless the message was like pinned recently after pinning pinned recently after sending*

  154. singpolyma

    In practise you almost certainly don't want to pin by ID, but rather make a copy. Otherwise if that message expires from the archive or similar... Sure you could specially protect it but then you need really specific support from the server which is quite gross. Our one pinned message is a copy now, it's just vaguely text only and only one which are the limitations we may need to overcome

  155. lovetox

    singpolyma, dont agree. This would make it *much* more complex, basically you are asking all clients that support this, to be able to restore a true xml representation of messages they have in the database

  156. lovetox

    whatfor? so the server does spare setting a flag on a database row that prevents it from deleting?

  157. singpolyma

    Doesn't need to be "true" just needs to look right when you render it 🙂 in fact for an omemo MUC you *need* it to *not* be true... And also can't use OMEMO at all for the pin which is a bit of an issue

  158. lovetox

    i dont see here anything "gross" server side

  159. singpolyma

    Would mean the server would need to know about pinning. Vs just being a bag of data (pubsub, MUC, etc)

  160. lovetox

    he gets a message, and parses some ids defined in a XEP .. the most trivial stuff imagineable, at the same time you dont have any doubts asking many devs to restore message xml representations for this feature

  161. lovetox

    then you open up the problem that the client that pins dont even understands everything in the message he tries to pin, meaning he cannot restore everything

  162. lovetox

    for example a file attachment

  163. singpolyma

    Sure, but that client wouldn't understand that anyway even if it were present

  164. lovetox

    then you have the abuse vector, where you can basically create every message in the name of someone else and pin it

  165. lovetox

    > Sure, but that client wouldn't understand that anyway even if it were present ?

  166. lovetox

    i pin a id, i dont need to understand any content at all

  167. singpolyma

    Assuming you have permission to pin. But yes I suppose that could be an issue in some cases

  168. lovetox

    if for some reason server cannot store the messages longterm, then i still want only send an id, and the server should simply attach the whole message as copy

  169. lovetox

    as servers store the xml anyway

  170. lovetox

    but i really doubt its a big problem for the server to preserve some messages

  171. moparisthebest

    When asking whether to implement something on the client or server, part of the trade-off is when do you want it

  172. moparisthebest

    If you are ok not having it for 10 years when the last Debian stable server upgrades, then server is fine

  173. moparisthebest

    Otherwise you want to do it on the client

  174. singpolyma

    Client is always better except for security which obviously must be done on server usually

  175. moparisthebest

    Tend to agree

  176. moparisthebest

    Partly because in 10 years everyone will want something else

  177. lovetox

    dont see the relevance here, this cannot be implemented without server

  178. lovetox

    if you store ids or message copies, you need to modify the server to store your new data

  179. moparisthebest

    Do it a way that you don't, pubsub ?

  180. singpolyma

    No server is putting pubsub on MUC jid right now, so you'd need to pick some pubsub. Which is annoying but doable in a pinch

  181. lovetox

    and then your problems start, you dont have a permission model that maps to MUC permissions, again even more server work