Question

I have been creating group chat application, while implementing group chat functionality I am facing problem, that when I every time join the room, open fire sends last two days messages.

Here is post message which I get every time when I join the room.

<message xmlns="jabber:client" id="05qEM-18" to="210@openfire.indianic.net/94e509b9" type="groupchat" from="top@conference.openfire.indianic.net/258"><body>Very good morning!!!</body><delay xmlns="urn:xmpp:delay" stamp="2014-03-19T05:15:06.542Z" from="258@openfire.indianic.net/Smack"/><x xmlns="jabber:x:delay" stamp="20140319T05:15:06" from="258@openfire.indianic.net/Smack"/></message>

Can any buddy suggest that where is option to disable history message on open fire server? So I will get each message only once.

Thanks in advance.

Was it helpful?

Solution

You should NOT disable group-chat history, you should specify that you does not want to receive history, as described in XEP-0045:

<presence
    from='hag66@shakespeare.lit/pda'
    id='n13mt3l'
    to='coven@chat.shakespeare.lit/thirdwitch'>
  <x xmlns='http://jabber.org/protocol/muc'>
    <history maxchars='0'/>
  </x>
</presence>

Your XMPP library should be able to specify "maxchars" or "maxstanzas" or "seconds" property of the room joining packet.

OTHER TIPS

Yes there is, but I do not recommend it! At the web admin page go to Group Chat section, in there, go to Group Chat Settings. If you don't have already, create a new service, then click it. It will take you to the Group Chat Service Properties. There on the left side, you'll find the History Settings, where you can set your history settings as you want it.

Images:

Step 1.

Step 2.

The best thing that I have found to do when managing any conversation history is to simply modify the embedded-db.script file. Just edit it will notepad++ and delete anything with the following statements (INSERT INTO OFPROPERTY VALUES) or (INSERT INTO OFROSTERGROUPS VALUES) or (INSERT INTO OFID VALUES). This will clear all chat history, including your group chat. You can sift through and delete only what you need of course. I would copy and paste the DB in case you delete something you need--make sure you stop the server first...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top