jdev - 2023-06-15


  1. lovetox

    hm about message correction, if i dont find the original that should be corrected, is it acceptable to drop the message?

  2. lovetox

    or lets say not drop, but at least not display like a normal message

  3. lovetox

    i find it not easy to treat a correction as "normal" message (so not a correction) because the original is not there, but suddenly later if i receive the original, treat the same message differently

  4. lovetox

    currently my plan was to have a "message" table, and a "corrections" table, i store all correction content only in the corrections table

  5. lovetox

    but that means if i load messages from the messages table, and the original is not in the table, corrections will also not get loaded

  6. lovetox

    resulting in basically a correction which the user received but never displayed

  7. lovetox

    i wonder now if this would be OK, or maybe there is a smarter database setup

  8. singpolyma

    That seems fine to me. Certainly easier than the other way

  9. lovetox

    yeah the more i think about it, it seems like the only sane way, especially if you want to have a setup where you request MAM backwards on user request

  10. atomicwatch

    I have a question, I'm trying to get MUC MAM to work for profanity but I'm getting 0 messages for my requests so I'm wondering if I'm doing something wrong. ``` <iq id="9aeeDp6B4jvseT4a2a0f157f8dc4d347b06d945b86306f32096a316" type="set"> <query xmlns="urn:xmpp:mam:2"> <x xmlns="jabber:x:data" type="submit"> <field type="hidden" var="FORM_TYPE"> <value>urn:xmpp:mam:2</value> </field> <field var="with"> <value>operators@muc.xmpp.org</value> </field> </x> <set xmlns="http://jabber.org/protocol/rsm"> <max>10</max> </set> </query> </iq> ``` This is what my request looks like

  11. lovetox

    remove the with

  12. atomicwatch

    But I only want messages from that muc

  13. lovetox

    thats why you send the iq to the MUC or not?

  14. lovetox

    i mean ok true you do not

  15. lovetox

    thats also an error

  16. lovetox

    the IQ needs to go to the archive

  17. lovetox

    not to your account jid

  18. lovetox

    its only to your account, if you want messages from your account

  19. atomicwatch

    I see, how do I do that?

  20. lovetox

    <iq id="9aeeDp6B4jvseT4a2a0f157f8dc4d347b06d945b86306f32096a316" type="set" to=operators@muc.xmpp.org >

  21. lovetox

    and lose the "with" filter, its useless for mucs

  22. atomicwatch

    Ok thank you very much

  23. lovetox

    with the "with" filter you could query your account MAM, and request only messages for a specific conversation

  24. lovetox

    but in a MUC all messages are addressed to the MUC JID

  25. atomicwatch

    It worked thank you very much. I was trying to find information in the MAM XEP but I don't see the to property there. Could I ask where I would be able to find this kind of info next time?

  26. lovetox

    puh .. i guess you need a bit of rfc knowledge for this

  27. lovetox

    a <iq> without "to" attribute

  28. lovetox

    means implicit <iq to=youraccount@domain.org>

  29. Zash

    I would say so.

  30. lovetox

    so every iq has implicit a "to" attribute if you dont overwrite it

  31. lovetox

    if you now read https://xmpp.org/extensions/xep-0313.html#archives_muc

  32. lovetox

    > A MUC service allowing MAM queries for a room MUST expose the MAM archive on the room's bare JID.

  33. lovetox

    then you would deduce, the iq needs to go to the JID where the archive is hosted

  34. lovetox

    the archive is hosted on the bare room JID , so < iq to="bareroomjid">

  35. atomicwatch

    Ah I see, for some reason I thought that meant I had to put it in the with property. Thank you I'll try reading the XEPs more carefully next time

  36. lovetox

    no worries, this comes with experience, just ask here and someone will help :)

  37. lovetox

    with <iq> in general you can ask yourself, where does it need to go? whats the target, from where do i want to request something? Often its your own account jid, your own server basically, and then in the examples the "to" attribute is missing because its not necessary, but that does not mean you can not address this <iq> to anyone else out there.

  38. Zash

    In theory, if group messages were stored in the account archive, the above query would have worked. But it doesn't because MUC is awkward and it would be so messy to store in the account archives, easier for the MUC to do it itself.