Not able to get previous group chat history using ruby xmpp4r - ruby-on-rails

I am using ruby xmpp4r library to implement multi user group chat application with openfire server. I have created chat room on openfire server successfully. If user joins into chat room with openfire credential it's not returning previous group chat history it returns only few messages for that I am using add_message_callback() method.
Below is the openfire Group Chat History Setting:
** Show Entire Chat History (Show the entire chat history to users joining a room.)-- True
What am I missing here ?
Anybody have sample code to get previous group history?

I ran a Wildfire server (successor to openfire), this setting seems to be server side. On wildfire admin console its controlled under Group Chat > History Settings. It has the following options there:
Don't Show History - Do not show a chat history to users joining a room.
Show Entire Chat History - Show the entire chat history to users joining a room.
Show a Specific Number of Messages - Show a specific number of the most recent messages in the chat. Use the box below to specify that number.

Related

Ban a user: how to kick him out of the chat room (trigger a client side event)

I have a chat app which is connected to Firebase / Firestore and utilizes Firebaseanimatedlist in conjunction with the realtime database. When an admin of a group bans a user, I save his userid and restrict his access to the chat room. But consider that the user is currently in the chat room when he is banned. So how do I trigger an event client side when the userid is now saved within an array (list) in Firebase to kick him out of the chat room is is currently in?
Is FCM an option?
Presuming that you are using the realtime aspect you can check the database whenever it is updated and if the user exists in the database either hide the content or leave the chat.

MUCLight Offline message fetch XMPP

Have any one implemented MUC Light that is Beta released in MongooseIM Chat server for XMPP.
How to fetch fetch following messages when
1) User are offline while they were added as participants of group.
2) Users who are members byt offline and get messages on the muc light group.
I have achieved mod_zero push to trigger the offline message to Users, Also able to store the message in mam_muc_message table in my chat server MySQL database. But how the client will fetch these messages and also be notified with all messages.
Any guidance is much appreciated.
http://mongooseim.readthedocs.io/en/latest/open-extensions/muc_light/
Thanks for suggestion and comments here is how i managed with small limitation.
When user is offline while he was added by some group by others, he wont get this create group stanza as muc-light suggest.
When he come online , there have to be someone atleast who send a group message
When he gets this message I fetch the group configuration and create a new group first and keep this message as pending to process.
Once group created then i link this pending message to this group.
Then I call the MUC light MAM messages as given in 6.2 XEP-0313 Message Archive Management
Then I fetch all the previous messages and add in my database and display on the screen.
The only limitation that is there is after he come online he can't go to server and ask ALL muc-light messages, some how coz the server is not available is thrown if I ask for traditional MAM process to give messages for muclight.****.com group ID so I use as they asked to fetch in above link.
Hope MUC Light Beta is improving ahead more taking this into consideration.

ejabberd syncing message from mysql archive

I am working on ejabberd for quite sometime now, I am replacing a third party Chat infra with Ejabberd inhouse. As it was production switch so we need to maintain the previous chat messages while switching to ejabberd.
So I have created all the rosters, migrated users to ejabberd which is all working fine, now main challenge that I am facing is with message migration. I am using mysql for users, rosters and messages. I am running a script which is directly pushing data to ejabberd mysql from previous chat infra.
But when I am connecting to a user, I am able to see new chat messages which were sent through ejabberd, but migrated chats for same user is not visible and not propagated back to client.
Can someone help here ?
Here are the two entries which I had put in mysql, first one is ejabberd entry and other one is manual, client is able to sync first one but not another.
username timestamp peer bare_peer xml txt id kind nick created_at
xyz-customer 1454573488523175 abc-provider#xxx.amazonaws.com abc-provider#xxx.amazonaws.com "<message from='xyz-customer#xxx.amazonaws.com/2131165549e1bc6553-32b9-4ec4-92bd-c9ed80fb5374' to='abc-provider#xxx.amazonaws.com' xml:lang='en' id='oG3Vb-568' type='chat'><body> CnsfjffsjJ</body><thread>90275196-0096-4bb4-a95d-d72ea5238f74</thread><request xmlns='urn:xmpp:receipts'/><delay xmlns='urn:xmpp:delay' stamp='2016-02-04T08:11:27.194+00:00' from='xyz-customer#xxx.amazonaws.com/2131165549e1bc6553-32b9-4ec4-92bd-c9ed80fb5374'/><markable xmlns='urn:xmpp:chat-markers:0'/><request xmlns='urn:urbanclap:request' requestId=''/><active xmlns='http://jabber.org/protocol/chatstates'/></message>" " CnsfjffsjJ" 208044 chat "2016-02-04 08:11:28"
xyz-customer 1454570506606317 abc-provider#xxx.amazonaws.com abc-provider#xxx.amazonaws.com "<message from='xyz-customer#xxx.amazonaws.com' to='abc-provider#xxx.amazonaws.com' xml:lang='en' id='I5sO7-2' type='chat'><body>GB hard</body><request xmlns='urn:xmpp:receipts'/><markable xmlns='urn:xmpp:chat-markers:0'/><active xmlns='http://jabber.org/protocol/chatstates'/></message>" "GB hard" 208045 chat NULL "2016-02-04 07:21:46"
I guess you are trying to fill the message archive table, but are expecting offline messages delivery. Please, make sure you are adding the message in the right table. I guess you are writing in archive table but should write in spool.
Please note that spool table to deliver offline message is only check on new user login. It is not a way to add messages to deliver to the user in a running session. It means you cannot really sync two running platforms by just writing in MySQL message table. You would need to actually route the messages by writing a custom ejabberd plugin.

Get Chat History From Zopim iOS Chat SDK

How do i get chat history for Zoipm chat iOS SDKs, i am logging using anonymous user using default controller, is there any pre-config to be set to get this.
From an end-user's perspective, there is no way of seeing a chat history. Each chat is treated more like a ticket as it creates a ticket with the transcript upon completion. A chat transcript can be sent to the end-user.
I suppose the end-user could look through their ticket history and effectively see the chats alongside their other submitted tickets.

How to receive offline messages in group chat from ejabbered in iOS?

I had implemented group chat, which is working fine. But problem is that:
how can i receive offline message when user goes out from group.
I had tried, When i set status of user to unavailable from group/chat session, the ejabbered doesn't store messages for that user.
And even doesn't store message in spool table.
Anyone please share some stuff!
Thanks!
Query to server with date parameter from current date to your desire past date .

Resources