Devoliping plugin - get offline messages without loosing them

Hi you all!

I needed to know the number of messages that an user have (offline messages) and may request some of them only.

I’‘ve to implement a plugin to get the number of offline messages that an user have… but I don’'t know where to begun… For example, where does Jive Messenger store the offline messages (I soppose in a db, but how can I get that db?..)

Any ideas?

Thanks in advance!

Hi Mamarin,

Offline messages can be accessed via the OfflineMessageStore class located in the org.jivesoftware.messenger package; to get the number of offline messages for a given user you can just do somethink like:

OfflineMessageStore oms = XMPPServer.getInstance().getOfflineMessageStore()
int numOfMsgs = oms.getMessages("bob").size();

Let me know if you need something more.

Hope that helps,

Ryan

To add to Ryan’'s tip, one way to expose this type of functionality at the protocol level would be to implement JEP-0013 – http://www.jabber.org/jeps/jep-0013.html.

Regards,

-Matt