pgstath / Sharp.Xmpp

Sharp.Xmpp is looking for a maintainer! Unfortunatelly I do not have currently the time needed to maintain the library. Luckily a small but vibrant community has evolved around Sharp.Xmpp. If you would like to be the project's maintainer please sent an email to pgstath@gmail.com. This should include issues, tickets and commits that you have done for Sharp.Xmpp or other similar project. Sharp.Xmpp is a multiplatform, Windows and Android, .NET XMPP client assembly.Sharp.Xmpp supports IM functionality & a variety of XMPP extensions, is simple and is extensively tested against Android Xamarin. It is a fork of the currently frozen excellent S22.Xmpp project. Sharp.Xmpp will be at the FOSSDEM 2016 Real time DevRoom!
Other
84 stars 51 forks source link

How to retrieve conversation history of users #55

Open onurhazar opened 7 years ago

onurhazar commented 7 years ago

Hi, I am trying to get list of archived messages between users from openfire. Client connection is successfully made and retrieving messages instantly but when I have two devices(same account) sending messages to someone in the same conversation, other second device didn't get what I sent previously so it looks like my sent messages are disappeared. I already implemented caching messages to device's database but it also needs to be updated. I saw there is a method called GetGroupChatLog but I am not sure if this fits or Sharp.Xmpp supports. Any idea would be greatly appreciated. Thanks!

Mofl2328 commented 7 years ago

I had the same problem with an eJabberd Server and I was able to receive an defined amount of history when entering a multi user chat but otherwise there isn't any option in Sharp.Xmpp to get any history.

But if you take a look at MaM (XEP-313) you have a protocol for requesting history for everything that is easy to use and not too much work to implement in Sharp.Xmpp based on the CustomIQExtension class.

Mofl2328 commented 7 years ago

My fork with the additional extension for xep-0313

I got around to upload my MaM Extension here too. It is pretty minimal (I only need before and after as option) and has no security checks on whether the server and the chat runs the archive node before calling it. Sadly calling the disco on the server is not enough to check for xep-313 support.

Work pretty good for me. One issue I noticed was just that you can't rely on the order of the messages you receive after calling the archive when you ask for higher number of old messages and have to compare the timestamps.

maciey commented 5 years ago

Hi Mofl2328,

Can you please advise what method I should call to get archived messages ? ( I see your changes, but still not sure what to call / how to receive history)

Apologs if naive question but Im quite new to the topic...