4

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.

Irfan
  • 4,301
  • 6
  • 29
  • 46
Jatin Patel - JP
  • 3,725
  • 2
  • 21
  • 43

3 Answers3

5

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.

vitalyster
  • 4,980
  • 3
  • 19
  • 27
  • Thanks for your replay, your suggestion will give me hint to achieve what i want.. it will save my so many hours.. once again thanks.. – Jatin Patel - JP Mar 20 '14 at 09:23
  • vitalyster my ios developer has tried to do what you've given above but it does not help can you please look into http://stackoverflow.com/q/40631928/2667307 @None Please have a look. – Shashank Shah Nov 21 '16 at 05:27
1

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.

Hampel Előd
  • 405
  • 2
  • 8
  • 19
  • I don't recommend it, because if you make your rooms persisents (they never get deleted), then I presume, that you wan't to get offline messages to from it. But a room sends you messages, only when your in the group and when you're offline, you're not in it... – Hampel Előd Mar 19 '14 at 14:18
  • thanks for your replay. but i have tried above things still i received history messages. can you please suggeste me if i left any things? I have completely followed your screenshot. – Jatin Patel - JP Mar 20 '14 at 07:01
  • I'm still searching, but I haven't found anything yet. What you could do is save the messages in your own database and when you join the room, you just check if you already have a message with the same id in the DB and if you do, then you don't show it on the UI. This is what you should use, because when you find a message with an unknown id, it means that you were offline when that was sent. – Hampel Előd Mar 20 '14 at 07:17
  • You could check if there's a plugin making openfire send out the message history – Hampel Előd Mar 20 '14 at 07:21
-1

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...

Rajesh
  • 10,318
  • 16
  • 44
  • 64
Adam
  • 1