0
votes

I am using openfire version 4.0.1

Using openfire Rest Api i have created group chat rooms in the service servicename.xx.xx.xxx.xxx.

Now rooms are created what is happening , once user connect to the xmpp server all the group messages are receiving back to that user which makes application stuck.

I heared about Group Chat History Settings under group chat settings.

enter image description here

I have truncate all the group messages which is stored in ofMessageArchive table of openfire.

Still, when user connects to the xmpp that user will receive all the messages of all the group which he is member with even though i have cleared all the messages from ofMessageArchive table.

How to prevent those messages which are comming through xmpp?

Any Help would appriciate.

1
Anyone experiencing same kind of issue ?Shashank Shah
Yes i have experienced the issue, can you share the presence packet which you are sending to join room?Shoaib Ahmad Gondal
@ShoaibAhmadGondal i am creating a room from ios end and create room object of xmpp and then activating room to my connected xmpp stream than after i am sending presence to stream (Presence type ="available")Shashank Shah
here is an example packet which contains history tag...so i want to look at the presence packet which is being sent from your side. kindly log the packet and share. <presence from='[email protected]/pda' id='n13mt3l' to='[email protected]/thirdwitch'> <x xmlns='jabber.org/protocol/muc'> <history maxchars='65000'/> </x> </presence>Shoaib Ahmad Gondal
"maxchars" or "maxstanzas" or "seconds" property of the room joining packet,this property is defining number of messages or seconds(in duration) which is messages limit.Accordingly that messages limit,messages are retrieve when user connected to room. for example maxchars = 2 then room stream return last 2 messages after successful connection to room.Kandhal Bhutiya

1 Answers

0
votes

You have to specify your Openfire version.

However, for Openfire 4.0.2

Groupchat history it's based on many params on database and some on client. Behaviour it's not ever linear.

1) in table OFPROPERTY the property xmpp.muc.history.reload.limit (this works in days, for example put 30 means "last 30 days")

2) in table OFMUCSERVICEPROP, for each serviceid, you can have (or not) 0+ values. For example, for serviceid 1 (conference), without params you'll get last 25 messages, or you can set by db or programmatically name history.type and type (all to get all the history, none for your case)

3) With smack API You can send a DiscussionHistory request while joining chat: with this object you can set to 0 all the parameters (like: number of stanzas and so on).

history.type it's the top level one to set: just declare it as none and no history will be retrived.