How to get openfire chat room Archive messages using Strophe library - xmpp

I use Strophe library to connect to an OpenFire XMPP server.
How can I receive the chat room archive of messages ?
I need to fetch messages based on start date and end date using strophe library.

I do not think Openfire does yet support Message Archive Management for MUC rooms yet. The code for MAM user archive support has been merged into Openfire in May, but I could not find any reference to support for MUC archiving.

Related

How can I get last message of each conversation(per JIDs) from openfire?

I'm developing an instant messaging app on android with SMACK library that uses OPENFIRE as a xmpp server. I want to get last message of each conversation from MessageArchiveManager in openfire server that was enabled by MONITORING SERVICE plugin(based on XEP-0313).
I know that mamManager.queryArchive() can gets the messages that related to specific jid or can get a specific number of messages that exists in server(with no custom sepration), but we suppose that smack doesn't knows which JIDs has conversation on server!
One solution is that send request per each ROSTER entry, but it has heavy cost when it contains numerous contacts and perhaps we have a conversation with anybody out of Roster. Is there any way or plugin or another extension to do this?

Openfire XMPP Bot over Channels

I am using Openfire as an XMPP server for building a customer support Bot framework.
I am planning to make use of channels/groups for the same. I am keen to use channels as there might be multiple human agents and a bot listening to the same conversation. So I am likely to have a group/channel for each individual.
I want the messages to be read and processed by my custom server. How do I go about this ? I couldn't find any plugin that allows me to intercept the messages and return back processed response.
Any recommendations ?
You can also create your an own openfire bot plugin if you are familiar with Java (small example: https://rmsol.de/2018/03/06/Openfire_Bot/). Otherwise create bot as a client lilke dontknow suggested (The "bot/client" will join every channel you like and e.g. listen for specific keywords)
I figured out that since Openfire is an XMPP Communication software, its best to just use a custom XMPP client ( on your own server ) to listen to all the messages and process it from there and reply back from the XMPP Client as well.
So if I have a Nodejs server, I will create a Node XMPP Client and listen to XMPP messages coming via Openfire from other users, will process them and reply back with custom messages which Openfire will send back to the user.

XMPP offline message push ejabberd

Hi I am developing a chat application using XMPP. Consider the situation in the chat application, When User A send messages to User B and if the User B is offline at that time XMPP will store the sms as offline message and it will send that messages to User B when it comes online. This is working here. But I want to send this offline messages from XMPP as push to User B. I have done lots of searching and I came in a conclusion that we need to send the offline messages from XMPP server to our backend server and from there we need to send that message as push. But how to do this, please help me
It is possible to write a custom module to do that with ejabberd API.
What you need is to use mod_offline_hook (see ejabberd Events and Hooks) to be called when the server wants to store a message in offline store.
You can read mod_offline module for inspiration.

Tracking MUC room list with XMPP (ejabberd)

I'd like to allow a client to keep track of the list of rooms on a multi-user chat service provided by ejabberd. This would require receiving notifications of room creation/destruction and presence events for all rooms on the server.
Is there a way to subscribe to receive notifications about such events without sending a presence event to, and therefore joining the roster of all rooms?
FWIW, I've found out how to send a request for the room list (http://xmpp.org/extensions/xep-0045.html#disco-rooms) and I've been trying to make sense of the pubsub system (http://xmpp.org/extensions/xep-0060.html#glossary) in hope that I'd find a solution there but nothing seems obvious.
What's the right(TM) way to do this in XMPP land?
Ubuntu 10.04 + ejabberd 2.1.5-3+squeeze1 + Strophe.js & BOSH & jQuery
You need to develop custom code for that, especially to trigger packets sending on the event you are interested.

How to send XMPP Message with a given From or ReplyTo?

I would like to initiate a Chat between two users A and B from my web application. So I create an XMPP Message using Smack Client API or directly from an OpenFire Plugin:
Send a Message by Smack from A to B
Send a Message by Smack from Server to B with replyTo A
XEP-0033 allow "replyTo address" supported by OpenFire but not suported by IM Clients.
It seems "from" can't be overrided by a client or an OpenFire plugin. I also think GTalk will not accept an xmpp message from userA#gmail.com to userB#gmail.com by ServerToServer protocol.
Is there an other way to do this ? I want my web application to forge a message from UserA to UserB. But this webapp is not A or B.
Best Regards,
Jp
Any XMPP server should ignore the from address in a stanza and stamp the one that it get's from the connection into the stanza it sends on. This is a specific feature of XMPP compliant servers and is used to stop address spoofing and spam etc. You'd probably have to edit the source of a server and change it's behaviour. This is dangerous though and I wouldn't reccomend it if you'll be federating with other servers.
J