3

xep-0313 works for rosters, but does not work for room chat. I can get archive message for the rosters, but I can not get archive message for the room, why?

<iq type='set' id='juliet1'>
  <query xmlns='urn:xmpp:mam:0'>
    <x xmlns='jabber:x:data' type='submit'>
       <field var='FORM_TYPE' type='hidden'>
           <value>urn:xmpp:mam:0</value>
       </field>
      <field var='with'>
         <value>roomJid@conference.host</value>
      </field>
   </x>
  </query>
</iq>

The receive message is:

<message xmlns="jabber:client" from="test3@192.168.1.67" to="test3@192.168.1.67/iPhone" id="dHS0oejBDWHp”>
 <fin xmlns="urn:xmpp:mam:0" complete="true”>
      <set xmlns="http://jabber.org/protocol/rsm”/>
 </fin>
 <no-copy xmlns="urn:xmpp:hints”/>
</message>
Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44
xhsoldier
  • 575
  • 6
  • 31

1 Answers1

1

I guess you are using ejabberd contributed module. However, a new official MAM module has been added to official ejabberd and it support latest version of MAM (0.4 as of today) and MUC archiving.

It has been released in ejabberd 15.06. You can can also get direct access to source from ejabberd Github repository. The module is here: https://github.com/processone/ejabberd/blob/master/src/mod_mam.erl

Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44
  • I will test this in the next couple of days. I also write a module to hook the user_send_packet, in the hook, I store the MUC messages in SQL. Then provide a http API to request the MUC messages. From the client side point of view, I use the HTTP API to query the MUC history messages. – xhsoldier Jun 24 '15 at 14:31
  • can I ask how do you use the http API to query the MUC history messages? I'm trying to get the history for a chat room by using this (http://stackoverflow.com/questions/31828955/xmpp-query-archive-by-latest-messages) but it only seems to work for individual users – nhenrique Sep 01 '15 at 16:19
  • You should try latest master branch. It is much much improved and stick to the latest specifications. – Mickaël Rémond Sep 01 '15 at 16:23