Opened 5 years ago

Last modified 22 months ago

#15653 new patch

Support XEP-0313 aka MAM (Message Archive Mgmt)

Reported by: krieger Owned by: deryni
Milestone: Patches Needing Review Component: XMPP
Version: Keywords: xmpp, xep-0313, mam
Cc: stpeter, devurandom, deoren, NickBrown, marsjaninzmarsa, bird.dandruff, blipp

Description

My initial wish is here: http://mail.jabber.org/pipermail/juser/2013-May/006962.html I have no strict sight how it shoud look in UI. I am ready to help actively with testing and debugging, and to provide MAM-enabled private jabber server for developer.

Change History (36)

comment:1 Changed 5 years ago by Aeyoun

I’m also willing to help test.

comment:2 Changed 5 years ago by notphilipfry

It might also be beneficial to simultaneously consider

XEP-0280 Message Carbons

And GUI work for these XEP would likely help

XEP-0016

comment:3 Changed 5 years ago by utapyngo

Any progress here? Message carbons are not very useful without MAM.

comment:4 Changed 5 years ago by devurandom

XEP-0280 is dealt with in bug #15508

comment:5 Changed 5 years ago by devurandom

XEP-0016 is dealt with in bug #1583 - please note that some consider it obsoleted by XEP-0191, which achieves a similar effect, but is much simpler.

comment:6 Changed 5 years ago by devurandom

XEP-0191 was bug #7670 and is already implemented in Pidgin since 2.5.4.

comment:8 Changed 4 years ago by CkNoSFeRaTU

Basic XEP-0313 support for pidgin: http://nosferatu.g0x.ru/pub/pidgin/pidgin-2.10.11-mam-basic-carbons.patch

Patch also includes xnyhps's patch for XEP-0280 (Message Carbons) from https://developer.pidgin.im/ticket/15508

comment:9 Changed 4 years ago by mase76

My pidgin (debian jessie) crashes with this patch after connecting to my account, but only, when there are archived messages in the database of prosody 0.10 with mod_mam. I think it is no serverside problem, because android conversations works with mam on my server.

comment:10 Changed 4 years ago by mase76

This seems to be the codepart, where the crash appears:

It is from line 539 after patching. libpurpe/protocols/jabber/message.c

if (result && !strncmp(to, from, strlen(from)))

is_outgoing = TRUE;

else if (sent)

is_outgoing = TRUE;

from is NULL, even id is NULL. packet is not NULL.

Last edited 4 years ago by mase76 (previous) (diff)

comment:11 Changed 4 years ago by CkNoSFeRaTU

It looks like prosody doesn't provide from attribute in message header when my ejabberd does. Please try updated patch by the same link above or from this repository: https://github.com/CkNoSFeRaTU/pidgin

comment:12 Changed 4 years ago by mase76

No more crash with that updated patch. But the mam messages appear in an endless loop.

comment:13 Changed 4 years ago by CkNoSFeRaTU

That is strange. Can you provide test account for reproducing the problem? My jid is nosferatu[on]jabber.ganjanetwork.ru, drop by anytime.

Last edited 4 years ago by CkNoSFeRaTU (previous) (diff)

comment:14 Changed 4 years ago by mase76

Got the account?

comment:15 Changed 4 years ago by Robby

  • Milestone set to Patches Needing Review
  • Type changed from enhancement to patch

comment:16 Changed 4 years ago by CkNoSFeRaTU

Nope, I doesn't. Message me to jabberid I provided earlier if you have one. Or email me to the email in my github profile.

comment:17 Changed 4 years ago by mase76

The modifications you did in your git repository work nearly perfect. I cannot understand, why the pidgin devs do not include such important things, as the patch is there. Carbons and message-archive-management are a must in modern messengers today. We have more than one device and want to keep our conversations in sync.

comment:18 Changed 4 years ago by v1r0x

But they still have to review the patch. And there are a lot of other open tickets.

Could anyone compile this version for windows? I tried it (both using cygwin and ubuntu) but no success :( Would like to test my server with MAM and CC enabled ;)

comment:19 Changed 3 years ago by stevenroose

Why is there a patch that solves this but is not yet applied??

Currently, the only desktop client with MAM support is Gajim :(

comment:20 Changed 3 years ago by pztrn

This "patch" isn't working with Prosody. And it's not setting query ID, so probably due to that history isn't syncing.

comment:21 follow-up: Changed 3 years ago by mase76

No problems with prosody 0.10 here. Older versions than 0.10 don't support the mam module.

comment:22 in reply to: ↑ 21 ; follow-up: Changed 3 years ago by pztrn

Replying to mase76:

No problems with prosody 0.10 here. Older versions than 0.10 don't support the mam module.

I'm using trunk now. I have "MAM Requesting" message in Pidgin logs, and "Archive query nil is completed" in Prosody logs. And have two questions:

  1. Why nil? When Gajim asks for logs, queries have IDs.
  2. How to access synced history? Or how to sync history?

comment:23 Changed 3 years ago by Vermus

any news? using prosody 0.10 with mam module - Gajim is ok. Want Pidgin.

comment:24 in reply to: ↑ 22 Changed 3 years ago by CkNoSFeRaTU

Replying to pztrn:

I'm using trunk now. I have "MAM Requesting" message in Pidgin logs, and "Archive query nil is completed" in Prosody logs. And have two questions:

  1. Why nil? When Gajim asks for logs, queries have IDs.

queryid is the optional parameter. As mentioned above patch have only basic mam functionality (it currently only requests missing messages since last connection and then on receiving messages through xep-0280 during that connection) there are no use of queryid now.

  1. How to access synced history? Or how to sync history?

Currently it requests messages on connection to server from time of last received message or time of activation mam support option in pidgin. If you want request once previous history you can:

1) exit pidgin.
2) open accounts.xml (on *nix it is in ~/.purple/accounts.xml)
3) find your account and associated parameter "mam_laststamp" and set it to any time in unixtime format from which you want to receive messages.
4) open pidgin and connect to server.

Also prosody implemeted xep-0313 v2 back then which is obsoleted. Dunno if currently something changes at this front. As initial patch required xep-0313 v3 the were some quirks which were fixed in repo. At least mase76 had no problems with it. Currently there are already xep-0313 v4 specification in the wild and I dunno if patch is compatible with it as I don't have time to read the changes.

I have test build which supports history scrollback fetch (like conversations) and some integration with pidgin history as it now use sqlite storage, but it need some more work and I rarely have any spare time.

comment:25 follow-up: Changed 3 years ago by andrey.utkin

Hi, it's me, the author of this ticket. Whoa, it is still open!

I give account on my MAM & Message Carbons enabled public server decent.im to Pidgin developers who will work on getting this feature upstream.

comment:26 in reply to: ↑ 25 ; follow-up: Changed 3 years ago by chaoscommander

Replying to andrey.utkin:

Hi, it's me, the author of this ticket. Whoa, it is still open!

I give account on my MAM & Message Carbons enabled public server decent.im to Pidgin developers who will work on getting this feature upstream.

How did that go? Can we hope for an implementation some time soon?

comment:27 in reply to: ↑ 26 Changed 3 years ago by pztrn

Replying to chaoscommander:

Replying to andrey.utkin:

Hi, it's me, the author of this ticket. Whoa, it is still open!

I give account on my MAM & Message Carbons enabled public server decent.im to Pidgin developers who will work on getting this feature upstream.

How did that go? Can we hope for an implementation some time soon?

I can confirm this patch works. Tried on Prosody trunk with mod_mam from trunk.

comment:28 Changed 2 years ago by stevenroose

And why hasn't this been merged yet??

comment:29 Changed 2 years ago by Murz

XEP-0313 aka MAM (Message Archive Management) is very useful feature, please merge this patch! Synchronize archive of chat messages in multiple devices already works on other popular messengers like Telegram, WhatsApp?, Viber, Skype, ets - please add this feature to opensource Jabber accounts too!

comment:30 Changed 2 years ago by Robby

CkNoSFeRaTU's patch link seems to be down but the changes can be found in their GitHub repo.

CkNoSFeRaTU, any chance you could create a pull request at Pidgin's Bitbucket repo? Development is more active than it has been for a long time and a host of third-party pull requests has been reviewed and merged there in recently. So chances are decent now to get your changes and xnyphs' in.

Last edited 2 years ago by Robby (previous) (diff)

comment:31 Changed 2 years ago by CkNoSFeRaTU

I highly doubt that patch can be merged to upstream "as is" in it's current state. First of all currently it targets legacy 2.x branch and all it's limitations. This branch looks like mostly bugfix only. Pidgin doesn't have any sql storage support and that limits whole xep-0313 idea.

MAM support is currently just a basic hack, it load messages from timestamp of last received/sent message on connection to server, don't distinguish between already received messages and new messages, can't request history from conferences, can't load messages on user request (with scrollback for example) and so on.

Also I purposely written mam part in the way so it doesn't depend on any purple internals so it can be easily ported to another client. As I wasn't sure at that time that pidgin suits my needs. That part must be also reworked.

Summing this up: we need to wait before 3.0.0 branch is more mature and stabilized, resolve limitations of internal storage capabilities and then do it properly before any upstreaming.

Meanwhile all users which satisfied with current functionality can use version from my repo on github. There are also windows build now as it was requested numerous times.

Last edited 2 years ago by CkNoSFeRaTU (previous) (diff)

comment:32 Changed 2 years ago by Robby

Thank you very much for your detailed response. :-)

Yes, the 2.x.y is mostly about bug fixing.

I believe the 3.0.0 branch is coming along nicely and I can't see a feature freeze being that far out. So now would be a good time to suggest changes necessary for MAM.

comment:33 Changed 2 years ago by Murz

Thanks for detailed description! Can you now apply current patch for 2.x version for already got some MAM support (not so good, but better that nothing) in current version of Pidgin, and after this - create better way for MAM support in 3.0 version?

comment:34 Changed 22 months ago by Murz

CkNoSFeRaTU, can you clone your github repository to Bitbucket and create pull request for ​Pidgin's Bitbucket repo? This will add MAM support for all current Pidgin users, without waiting for 3.0 release.

comment:35 Changed 22 months ago by Murz

I also try to compile Pidgin from your repository - it compiles without errors, but after this I run pidgin and don't see XMPP protocol in it. Maybe I must add some options to configure for enable it?

comment:36 Changed 22 months ago by Murz

For full sync of chat history seems we need to wait when Pidgin message archive will be moved from plain html files to database https://developer.pidgin.im/wiki/RemoteLogging Here is issue about this: https://developer.pidgin.im/ticket/4800

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!