Mod Mam Muc

Hi.. am trying to get mod_mam working with mod_muc

Am using 'master' branch latest as of yesterday 15 Feb 2016.

Have confirmed that the room is saving messages to the archive by examining database directly. There are some messages to search. User is a member of the room and has posted messages successfully.

Am unable to successfully request records from the archive.

<iq xmlns="jabber:client" id="awmin@mydomain.org/web" type="set">
   <query xmlns="urn:xmpp:mam:0">
      <x xmlns="jabberdata" type="submit">
         <field var="FORM_TYPE">
            <value>urn:xmpp:mam:0</value>
         </field>
         <field var="with">
            <value>myconf@conference.mydomain.org</value>
         </field>
      </x>
      <set xmlns="http://jabber.org/protocol/rsm">
         <max>30</max>
         <before />
      </set>
   </query>
</iq>

And the response is...

<wrapper>
   <message xmlns="jabber:client" from="awmin@mydomain.org" to="awmin@mydomain.org/web">
      <fin xmlns="urn:xmpp:mam:0" complete="true">
         <set xmlns="http://jabber.org/protocol/rsm">
            <count>0</count>
         </set>
      </fin>
   </message>
</wrapper>

I note that in this thread: https://www.ejabberd.im/forum/25254/getting-muc-messages-ejabberd @badloop says that 'withroom' is needed.. we can't get that to work and searching the source code for the word 'withroom' I can find no mention of this at all.

Since our request stanza might be wrong as it is our strophe version used for one to one chat mam (which is working) we also tried this version of the request stanza, taken from the xep..

<iq type='set' id='alkjdfasdf'>
  <query xmlns='urn:xmpp:mam:1'>
    <x xmlns='jabber:x:data' type='submit'>
      <field var='FORM_TYPE' type='hidden'>
        <value>urn:xmpp:mam:1</value>
      </field>
      <field var='with'>
        <value>myconf@conference.mydomain.org</value>
      </field>
    </x>
  </query>
</iq>

richp10 wrote: I note that in

richp10 wrote:

I note that in this thread: https://www.ejabberd.im/forum/25254/getting-muc-messages-ejabberd @badloop says that 'withroom' is needed.. we can't get that to work and searching the source code for the word 'withroom' I can find no mention of this at all.

Forget about that, it was before the XEP explained that MUC can be used, and got implemented correctly in ejabberd 16.01

richp10 wrote:

Am unable to successfully request records from the archive.

<iq xmlns="jabber:client" id="awmin@mydomain.org/web" type="set">
   <query xmlns="urn:xmpp:mam:0">
      <x xmlns="jabberdata" type="submit">
         <field var="FORM_TYPE">
            <value>urn:xmpp:mam:0</value>
         </field>
         <field var="with">
            <value>myconf@conference.mydomain.org</value>
         </field>
      </x>
      <set xmlns="http://jabber.org/protocol/rsm">
         <max>30</max>
         <before />
      </set>
   </query>
</iq>

Since ejabberd 16.01 you can do this:

<iq type="set" to="myconf@conference.mydomain.org">
   <query xmlns="urn:xmpp:mam:0">
      <set xmlns="http://jabber.org/protocol/rsm">
         <max>30</max>
         <before />
      </set>
   </query>
</iq>

Perfect, thank you so

Perfect, thank you so much..

Small follow up question.. this is working for an admin user but not regular user. I am struggling to see how to set user permissions for this.

Hi I used ejabberd 16.04 When

Hi
I used ejabberd 16.04

When i try send request

<iq type="set" to="myconf@gc.dmc.com">
   <query xmlns="urn:xmpp:mam:0">
      <set xmlns="http://jabber.org/protocol/rsm">
         <max>30</max>
      </set>
   </query>
</iq>

On server side i receive error

[error] <0.1794.0>@ejabberd_hooks:run_fold1:368 {function_clause,[{mod_mam,select,[<<"dmc.com">>,{jid,<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>,<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>},{jid,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<>>,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<>>},none,[],none,{rsm_in,100,undefined,undefined,undefined},{groupchat,moderator,{state,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<"dmc.com">>,{muc,muc_create,muc_admin,muc},{jid,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<>>,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<>>},{config,<<>>,<<"{\"created\":\"1466672810452\",\"name\":\"213\"}">>,true,true,false,anyone,true,true,false,false,true,true,false,false,true,true,false,<<>>,false,[moderator,participant,visitor],true,1800,100,false,<<>>,{0,nil},true},{dict,1,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[[{<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>}|{user,{jid,<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>,<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>},<<"70000000000">>,moderator,{xmlel,<<"presence">>,[{<<"to">>,<<"b1d122a6-e634-40e8-a27f-65696e0813f0@gc.dmc.com/70000000000">>}],[{xmlel,<<"c">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/caps">>},{<<"hash">>,<<"sha-1">>},{<<"node">>,<<"https://github.com/robbiehanson/XMPPFramework">>},{<<"ver">>,<<"VyOFcFX6+YNmKssVXSBKGFP0BS4=">>}],[]},{xmlel,<<"x">>,[{<<"xmlns">>,<<"vcard-temp:x:update">>}],[{xmlel,<<"photo">>,[],[]}]},{xmlel,<<"timestamp">>,[{<<"xmlns">>,<<"com:dmc:message:info">>},{<<"value">>,<<"1466708494100277">>}],[]}]}}]],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},nil,{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},{dict,1,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[[<<"70000000000">>,{<<"70000000000">>,<<"dmc.com">>,...}]],...}}},...}}],...},...]}
running hook: {muc_process_iq,[{state,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<"dmc.com">>,{muc,muc_create,muc_admin,muc},{jid,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<>>,<<"b1d122a6-e634-40e8-a27f-65696e0813f0">>,<<"gc.dmc.com">>,<<>>},{config,<<>>,<<"{\"created\":\"1466672810452\",\"name\":\"213\"}">>,true,true,false,anyone,true,true,false,false,true,true,false,false,true,true,false,<<>>,false,[moderator,participant,visitor],true,1800,100,false,<<>>,{0,nil},true},{dict,1,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[[{<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>}|{user,{jid,<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>,<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>},<<"70000000000">>,moderator,{xmlel,<<"presence">>,[{<<"to">>,<<"b1d122a6-e634-40e8-a27f-65696e0813f0@gc.dmc.com/70000000000">>}],[{xmlel,<<"c">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/caps">>},{<<"hash">>,<<"sha-1">>},{<<"node">>,<<"https://github.com/robbiehanson/XMPPFramework">>},{<<"ver">>,<<"VyOFcFX6+YNmKssVXSBKGFP0BS4=">>}],[]},{xmlel,<<"x">>,[{<<"xmlns">>,<<"vcard-temp:x:update">>}],[{xmlel,<<"photo">>,[],[]}]},{xmlel,<<"timestamp">>,[{<<"xmlns">>,<<"com:dmc:message:info">>},{<<"value">>,<<"1466708494100277">>}],[]}]}}]],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},nil,{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},{dict,1,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[[<<"70000000000">>,{<<"70000000000">>,<<"dmc.com">>,<<"6020919492456366405146">>}]],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},{dict,5,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[[{<<"77021173000">>,<<"dmc.com">>,<<>>}|{member,<<>>}]],[],[[{<<"61481469463">>,<<"dmc.com">>,<<>>}|{member,<<>>}]],[],[[{<<"77776963138">>,<<"dmc.com">>,<<>>}|{member,<<>>}]],...}}},...},...]}
Syndicate content