jdev - 2019-09-24


  1. paria

    hi everyone, how can i have my messages archive for specific user?

  2. paria

    😥

  3. moparisthebest

    paria, can you be more specific

  4. paria

    i'm using xmpp server to create a chat app one to one

  5. paria

    already i have all messages archive, but i want to filter it by specific jabber id

  6. paria

    the question is how to make query to get archive just for user X or Y or ...

  7. moparisthebest

    a specific JID already only has access to their own archive though, right?

  8. paria

    how?

  9. paria

    do you have any example?

  10. paria

    moparisthebest

  11. Daniel

    paria: have you read xep313?

  12. paria

    yesss

  13. paria

    but not working

  14. paria

    <body rid="3487398716" sid="104eace1e302ddcce25e726868f0af7d91589a18" xmlns="http://jabber.org/protocol/httpbind"><iq id="a2" type="set" xmlns="jabber:client"><query xmlns="urn:xmpp:mam:2"><with>paria@ejabberd</with></query></iq></body>

  15. paria

    <body rid="3487398716" sid="104eace1e302ddcce25e726868f0af7d91589a18" xmlns="http://jabber.org/protocol/httpbind"> <iq id="a2" type="set" xmlns="jabber:client"><query xmlns="urn:xmpp:mam:2"> <with>paria@ejabberd</with> </query></iq></body>

  16. Daniel

    Not working how?

  17. paria

    this is my created xml

  18. paria

    based on xep313

  19. paria

    based on xep313 for filtering

  20. Daniel

    Compare that to example 6

  21. paria

    ok

  22. paria

    Daniel is example 6 the server response? right?

  23. Daniel

    no

  24. paria

    it is my xml to send??

  25. paria

    r u sure?

  26. paria

    i'm completly confused

  27. Daniel

    you might want to re-read section 4 of the xep

  28. paria

    i'm completely confused

  29. paria

    ok i'll

  30. paria

    Daniel r u there?

  31. Daniel

    paria, yes

  32. paria

    i'm getting reponse from server like this

  33. paria

    <iq xmlns =" jabber:client " xml:lang =" en " to =" admin@ejabberd/31559446851458370303810 " from =" admin@ejabberd " type =" result " id =" archive2 " > <query xmlns =" urn:xmpp:mam:2 " > <x xmlns =" jabber❌data " type =" form " > <field var =" FORM_TYPE " type =" hidden " > <value > urn:xmpp:mam:2 </value > </field> <field var =" with " type =" jid-single " label =" User JID " / > <field var =" start " type =" text-single " label =" Search from the date " / > <field var =" end " type="text-single" label <iq xmlns =" jabber:client " xml:lang =" en " to =" admin@ejabberd/31559446851458370303810 " from =" admin@ejabberd " type =" result " id =" archive2 " > <query xmlns =" urn:xmpp:mam:2 " > <x xmlns =" jabber❌data " type =" form " > <field var =" FORM_TYPE " type =" hidden " > <value > urn:xmpp:mam:2 </value > </field> <field var =" with " type =" jid-single " label =" User JID " / > <field var =" start " type =" text-single " label =" Search from the date " / > <field var =" end " type =" text-single " label =" Search until the date " / > </x> </query> </iq> =" Search until the date " /> </x> </query> </iq>

  34. paria

    1 momment

  35. Daniel

    paria, in response to what request?

  36. paria

    getArchive() { let archive = this.state .$iq({ type: "set", id: "archive1" }) .c("query", { xmlns: "urn:xmpp:mam:2" }) .c("with") .t(this.state.connection.jid); console.log("history", archive); this.state.connection.send(archive.tree()); }

  37. paria

    this

  38. paria

    getArchive() { let archive = this.state .$iq({ type: "get", id: "archive1" }) .c("query", { xmlns: "urn:xmpp:mam:2" }) .c("with") .t(this.state.connection.jid); console.log("history", archive); this.state.connection.send(archive.tree()); }

  39. Daniel

    paria, can you show me the xml?

  40. paria

    yes

  41. paria

    w8

  42. Zash

    What library are you using? Is there no MAM support?

  43. paria

    <body rid="1446034458" sid="46bada5449ccb61b52966b424f7ea8ee9ecbc879" xmlns="http://jabber.org/protocol/httpbind"> <iq id="archive1" type="set" xmlns="jabber:client"><query xmlns="urn:xmpp:mam:2"/></iq> <iq id="archive2" type="get" xmlns="jabber:client"><query xmlns="urn:xmpp:mam:2"><with>paria@ejabberd</with></query></iq> </body>

  44. lovetox

    paria, this query is wrong

  45. lovetox

    look at example 6 of the XEP

  46. paria

    Zash strophejs

  47. Zash

    Pretty sure someone wrote a MAM plugin for that

  48. paria

    https://github.com/strophe/strophejs-plugin-mam

  49. paria

    this is the plugin but it has some errors

  50. paria

    Daniel i should create example 6 xml?

  51. lovetox

    yes paria as the example description tells you

  52. paria

    now the server response is like example 6

  53. lovetox

    "Querying for all messages to/from a particular JID"

  54. lovetox

    where do you got the idea to do a <with>paria@ejabberd</with>

  55. lovetox

    this is nowhere to be found in the xep

  56. paria

    in one document which i read before,

  57. paria

    but it's wrong

  58. Daniel

    just follow the examples in the XEP

  59. lovetox

    do servers do that autoreply on preapproval of roster additions the RFC6121 mentions?

  60. lovetox

    https://tools.ietf.org/html/rfc6121#section-3.1.3

  61. Ge0rG

    I wouldn't be surprised if servers didn't implement that at all

  62. kevin

    i hope everyone is having a wonderful day

  63. allie

    kevin:

  64. kevin

    whats up allie

  65. allie

    oops that was an accident lol

  66. allie

    nada, you?