Opened 5 years ago

Last modified 8 months ago

#15508 new patch

Support for XEP-0280: Message Carbons

Reported by: xnyhps Owned by: deryni
Milestone: Patches Needing Improvement Component: XMPP
Version: 2.10.6 Keywords: xmpp carbons jabber
Cc: utapyngo, devurandom, aka_bigred, holger, poelzi, ari, szr, vext01, b6fan, lameventanas, NickBrown, marsjaninzmarsa, bird.dandruff, blipp

Description

I think it would be great if libpurple supported XEP-0280: Message Carbons. It would make scenarios with multiple clients logged in at once much easier to handle.

I'm attaching a patch that implements support for this in libpurple. It adds a new menu item to any XMPP account that is logged in and where the server has indicated it supports Carbons (I think this is less confusing than adding a setting to the account's preferences that many servers won't support), allowing the user to toggle carbons on or off (if it had previously been set to on, it will enable it automatically when logging in).

The XEP's status is still Experimental, so I don't think Pidgin will add it yet, but it's good to have the code exist, in my opinion.

UIs will still need to be updated to support it: I think many of them don't properly handle PURPLE_MESSAGE_SEND.

(I'm opening a new ticket instead of updating #14663, as that one specifically requests it for GTalk, which currently uses a custom extension to do this.)

Attachments (5)

carbons.patch (12.2 KB) - added by xnyhps 5 years ago.
Patch for XEP-0280 support in libpurple.
carbons.2.patch (12.7 KB) - added by xnyhps 4 years ago.
carbons.3.patch (11.9 KB) - added by xnyhps 4 years ago.
carbons.4.patch (12.0 KB) - added by xnyhps 4 years ago.
carbons.5.patch (12.5 KB) - added by Gordin 4 years ago.
carbons.4.patch would always treat carbon messages as receveived from others. This updated patch fixes that.

Download all attachments as: .zip

Change History (67)

Changed 5 years ago by xnyhps

Patch for XEP-0280 support in libpurple.

Changed 4 years ago by xnyhps

comment:1 Changed 4 years ago by xnyhps

Added a new patch with the hg-metadata the commit I added on adium's branch has.

Changed 4 years ago by xnyhps

comment:2 follow-up: Changed 4 years ago by xnyhps

There was a security issue I missed in the patch (didn't properly check if the message came from your own JID, allowing anyone to fake carbon-messages). I've fixed it and cleaned up that code a bit.

Changed 4 years ago by xnyhps

comment:3 Changed 4 years ago by xnyhps

I hadn't noticed there was a version urn:xmpp:carbons:2 of the spec, I had implemented urn:xmpp:carbons:1. I've updated it to use version :2 (not much is changed, but the hierarchy of the <forwarded> element in :1 could conflict with other future XEPs).

comment:4 Changed 4 years ago by ernierasta

Thank you for great patch! After brief testing works very well with latest prosody jabber server. I think it should be included in default pidgin.

I personally think, it would be better to configure it in account settings. If you have jabber account with many ad-hoc commands available, it is hard to realize where it can be turned on. And if you have jabber server with carbons ad-hoc options enabled, you end up with 4 carbon related options in account menu. But it is minor thing.

Great work!

comment:5 Changed 4 years ago by xnyhps

My rationale to make it a menu item instead of a field on the account's preferences was that the possibility of enabling it depends on wether the server supports it.

I think it would be even more confusing to have a "Enable message copies" in the account's preferences which does nothing on 90% of the servers. In general the account preferences seem to be static, and anything depending on server support is added as a menu item.

comment:6 Changed 4 years ago by ernierasta

You are probably right. :-)

Never mind how they are enabled, it is great to have carbons in Pidgin.

Have nice day!

comment:7 Changed 4 years ago by utapyngo

Any news about this feature? When will it be included into Pidgin for Windows?

comment:8 Changed 4 years ago by Robby

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

Changed 4 years ago by Gordin

carbons.4.patch would always treat carbon messages as receveived from others. This updated patch fixes that.

comment:9 Changed 3 years ago by blubberblubb

So are there actually any plans to incorporate this patch?

This is the SINGLE MAJOR issue about which all my jabber-using friends complain about! In fact, many have jumped over to threema or G+ because of the constant message-goes-to-wrong-device madness of jabber/xmpp. And, oh what a surprise, pretty much ANY other messaging service handles this better. (usually by simply sending the message everywhere)

Please consider adding this in! It will never happen if nobody starts supporting this. It can be an optional thing which can be enabled in the preferences, but please at least have it compiled into the regular release so that a regular user can enable it without recompiling the whole Pidgin client.

comment:10 follow-up: Changed 3 years ago by aka_bigred

I want to echo everything that @blubberblubb said.

It's pretty sad that in this day & age where people regularly use multiple devices (desktop/laptop/tablet/mobile phone/etc) to communicate, that pidgin still doesn't support carbons. The patch is done, can we get someone to look at it and incorporate it so that users don't need to recompile from source just for this feature?

I can't tell you how many times I (unknowingly) get a message on the wrong device. It's a very annoying situation and I know many users would be very appreciative if pidgin supported carbons. I've got to think that at least some of the people involved with the project have been burned by a message going to their phone or PC when they were using the other device.

Please, include this patch in the core!

comment:11 in reply to: ↑ 10 ; follow-up: Changed 3 years ago by utapyngo

Replying to aka_bigred:

at least some of the people involved with the project have been burned by a message going to their phone or PC when they were using the other device.

They all seem to use Facebook, Google Talk and Skype.

that pidgin still doesn't support carbons

That is why I am still on Gajim 0.16-rc1.

Dear developers, are there any problems with this patch? Is so, please share your thoughts. The community can help.

comment:12 Changed 3 years ago by ernierasta

After 12 months I am bumping this patch again. Please devs, it is done, just review it merge please. I know, that whining here will not help you, but hopefully brings attention to carbons in pidgin.

comment:13 in reply to: ↑ 11 Changed 3 years ago by aka_bigred

Replying to utapyngo:

Replying to aka_bigred:

at least some of the people involved with the project have been burned by a message going to their phone or PC when they were using the other device.

They all seem to use Facebook, Google Talk and Skype.

Fair enough, but when a patch has already been written for you, what's the hold up?

that pidgin still doesn't support carbons

That is why I am still on Gajim 0.16-rc1.

I've thought about switching to something else, but in my situation I've got limited options. My workplace uses Lotus Notes Sametime (which I wholeheartedly detest), but I use XMPP for personal communications. I need a tool that does both, and pidgin does.

Dear developers, are there any problems with this patch? Is so, please share your thoughts. The community can help.

Agreed - if you need alpha/beta testers, you know where you can find willing & eager participants.

DEVS - I don't want to sound completely ungrateful for what really is a great app, we do honestly appreciate all the hard work you have put into this project, but is there something holding up the inclusion of this patch for carbons?

comment:14 Changed 3 years ago by autonomy

I made it work as well. Works really well. Please incorporate.

Last edited 3 years ago by autonomy (previous) (diff)

comment:15 Changed 3 years ago by scarleo

Message carbons is really needed in Pidgin, hopefully it can be integrated soon. Is it possible to make this patch as a plugin in the meantime?

comment:16 follow-up: Changed 3 years ago by autonomy

I tested some more. Can we not carbon OTR messages? It doesn't make a lot of sense at the moment because we can't sync keys.

comment:17 in reply to: ↑ 16 Changed 3 years ago by xnyhps

Replying to autonomy:

I tested some more. Can we not carbon OTR messages? It doesn't make a lot of sense at the moment because we can't sync keys.

To the contrary, I think we should definitely carbon-copy OTR messages. If you don't it'd be much more likely that an OTR message ends up only at the wrong instance which can't decrypt it. The instance tag support libotr 4 should make it handle this very well.

comment:18 Changed 3 years ago by poelzi

I used pidgin for many years now and was more or less happy. For me its not understandable how this bug gets so little attention - don't you devs use jabber on multiple devices like the rest of us ?

But this bug bothers me just to much, goodby pidgin, will go to gajim now.

comment:19 Changed 3 years ago by bradlaue

Is there an official policy against supporting experimental XEP's in libpurple?

Also, OTR shouldn't be considered an issue. OTR makes deep assumptions about how it's going to be used and only weakly supports multiple client connections. If one is using OTR one has to expect problems when multiple clients are connected - if anything, OTR could toggle off carbons or something.

In any case I don't think that's a valid reason not to include this. XEP-0280 and XEP-0198 are essential.

comment:20 Changed 3 years ago by SamWhited

What is the status of this patch / issue?

comment:21 Changed 3 years ago by nobody99283

The status is that this patch is mandatory for many people, none of the dev's care and it will lay around here for another 3 years.

I tried to set up an debian cross-compile environment because of this patch but the documentation seems to be out of date and trying to get it run only created an intense pain in my rear food output interface.

Is there maybe someone here that could share the windows binaries of the current vanilla pidgin with just this patch applied? Thanks a lot.

comment:22 Changed 3 years ago by autonomy

For everybody that wants to use the patch in Debian/Ubuntu?: apt-get source pidgin apt-get build-dep pidgin cd pidgin-2.10.9 patch -p1 < carbons.5.patch dpkg-source --commit dpkg-buildpackage -us -uc dpkg -i *.deb

Last edited 3 years ago by autonomy (previous) (diff)

comment:23 Changed 3 years ago by SamWhited

If you're using an Arch based Linux distro, I threw together a PKGBUILD which incorporates this patch and stuck it up on AUR here: https://aur.archlinux.org/packages/pidgin-extras/

comment:24 Changed 3 years ago by lorenz

Regarding OTR, the XEP specifies that single messages can be marked as private. It explicitly mentions end-to-end encrypted messages as a use case for this. See http://xmpp.org/extensions/xep-0280.html#avoiding

I think not CC'ing OTR'ed messages would be the optimal solution, since OTR is not designed to be used with more than one client on each end anyway.

comment:25 follow-up: Changed 3 years ago by nobody99283

There is a Dockerfile that builds the last Pidgin version from source and applies this patch for Windows:

https://github.com/Draghtnod/Pidgin-GPG/blob/master/Dockerfile

comment:26 in reply to: ↑ 25 Changed 3 years ago by dlc2015

I've been going nuts for the past few weeks trying to implement Message Carbons (XEP-0280) and Message Delivery Receipts (XEP-0184; I probably shouldn't mention that one in this ticket in Pidgin Win32, but if anyone's interested, you can download a plugin from: https://www.assembla.com/spaces/pidgin-xmpp-receipts/documents). I didn't want to invest the time to set up a development environment. But, after setting your Dockerfile, I went ahead and set up a build environment in Debian today and built the latest version of Pidgin with Message Carbon support. Thanks for this. I owe you a beer.

I've seen other requests for a download link for Pidgin Win32 with Message Carbon support. I have placed a copy in my DropBox? and I'd be happy to publish it here, but until I know if I'm violating the licensing, I can't publish it. Please advise.

comment:27 Changed 3 years ago by SamWhited

@dlc2015: Looks nice; do you happen to have a stable download link for that (the assembla ones expire after a while)?

I'm going to look it over, and I probably wouldn't mind automatically building/installing that with my pidgin-extras package for Arch Linux.

comment:28 Changed 3 years ago by dlc2015

@SamWhited?: I obtained the Assembla link from a different Pidgin Ticket. I could look it up and provide it if you'd like. I did, however, download the source code and DLL and also placed them on my DropBox?.

I really hope someone can tell me that providing a DropBox? link to the Pidgin Win32 with Message Carbons DOES NOT violate any licensing issues. I'd really like to share it with anyone that wants it. Before building it, I spent a fair amount of time trying to see if anyone had built it. All I was able to find were Linux versions that people had built. For my own purposes, I'll probably build it each time a new release of 2.10.x is released, so I don't mind updating my DropBox? with it.

comment:29 Changed 3 years ago by SamWhited

@dlc2015: Nevermind, thanks; I found the Git repo.

comment:30 Changed 3 years ago by dlc2015

I've been looking for a good XMPP client for Android that supports Message Carbons. Each one is lacking in one way or another either crashes occasionally or loses its connection to my Prosody server and won't connect without manual intervention. The most reliable XMPP client for Android I've found is XABBER which doesn't support Message Carbons. However, the devs seemed to have abandoned it. Fortunately, someone put together a PULL request (like this one for Pidgin) which adds Message Carbons. I built the APK which includes this support. So, now Pidgin + Xabber + Prosody gives me message carbons across Windows, Linux and Android.

I'd be happy to hand-off the binaries for Pidgin and Xabber to anyone who wants to make them available to those that needs Message Carbons + Message Receipts.

Last edited 3 years ago by dlc2015 (previous) (diff)

comment:31 Changed 3 years ago by szr

I am currently in the process of setting up a suitable build environment for building pidgin, so I will be more than happy to attempt a build on my own when I get an opportunity. I would however be very grateful if someone could profide a recent libpurple dll with the patches applied. Thanks.

comment:33 in reply to: ↑ 32 Changed 3 years ago by szr

Replying to nobody99283:

https://github.com/Draghtnod/Pidgin-GPG/releases

Thank you very much. I installed pidgin-2.10.11.XEP-0280.exe in the .7z archive but I cannot find any menu item for enabling message carbons anywhere.

comment:34 Changed 3 years ago by nobody99283

There is no GUI implemented for this patch. You have to set

<setting name='carbons' type='bool'>1</setting>

in your accounts.xml. I don't know why there is a flag at all. It should be always on in the first place since the server tells if this is supported or not anyway.

Last edited 3 years ago by nobody99283 (previous) (diff)

comment:35 follow-up: Changed 3 years ago by xnyhps

There is GUI for this, there's a "Enable Message Copies" in the account's menu if your server supports it.

I disagree that it should simply be on all the time, there are many people with limited and expensive bandwidth.

comment:36 in reply to: ↑ 35 Changed 3 years ago by autonomy

Replying to xnyhps:

There is GUI for this, there's a "Enable Message Copies" in the account's menu if your server supports it.

I disagree that it should simply be on all the time, there are many people with limited and expensive bandwidth.

I use jabber on my phone a lot with "Conversations" and it cost next to no traffic. I really wouldn't worry about the couple of extra bytes. I use ~5MB a month for jabber and it is my primary text app. Just my 2ct.

comment:37 Changed 3 years ago by vext01

Expressing interest in this feature also. +CC.

comment:38 Changed 3 years ago by b6fan

Insterested +1. +CC

comment:39 Changed 3 years ago by davidbm

Just started a bounty: https://www.bountysource.com/issues/1410118-support-for-xep-0280-message-carbons

I hope this is the right way to help pidgin? I cannot code by myself, as of a lack of time, but would be happy so see this in pidgin.

comment:40 follow-up: Changed 3 years ago by EionRobb

Whilst technically correct, I've found the use of serv_got_im(..., PURPLE_MESSAGE_SEND) isn't well supported by UI, and other prpl's will use purple_write_conversation() instead. In Pidgin in particular the use of _write_conversation() will colour the text in Blue as if it were sent from the client and won't trigger the 'outgoing IM' sound. In Adium, the message will be displayed (as opposed to using serv_got_im() which will not display the message at all).

In a semi-unrelated note, has anyone tried turning this into a plugin instead?

comment:41 in reply to: ↑ 40 Changed 3 years ago by xnyhps

Replying to EionRobb:

Whilst technically correct, I've found the use of serv_got_im(..., PURPLE_MESSAGE_SEND) isn't well supported by UI, and other prpl's will use purple_write_conversation() instead. In Pidgin in particular the use of _write_conversation() will colour the text in Blue as if it were sent from the client and won't trigger the 'outgoing IM' sound. In Adium, the message will be displayed (as opposed to using serv_got_im() which will not display the message at all).

The only difference I see between calling serv_got_im and purple_conv_im_write directly appears to be that serv_got_im fires a couple of signals ("blocked-im-msg", "receiving-im-msg" and "received-im-msg") and that serv_got_im (server.c:554) sets:

	/*
	 * XXX: Should we be setting this here, or relying on prpls to set it?
	 */
	flags |= PURPLE_MESSAGE_RECV;

Now I think a message with flags PURPLE_MESSAGE_RECV | PURPLE_MESSAGE_SEND makes sense (it's a message that was sent by you, but you also received it). But if some UIs can't handle this, then maybe the flags |= PURPLE_MESSAGE_RECV line should be removed? I think the effect would be the same, and it wouldn't require API-hacks.

How did you test this in Adium? This patch has been applied to Adium 1.6hg for a while (with some minor modifications to the UI), and there it seems to work fine.

In a semi-unrelated note, has anyone tried turning this into a plugin instead?

I haven't.

comment:42 Changed 3 years ago by davidbm

Looking really forward to see this in pidgin. Anyone working on it atm?

comment:43 Changed 2 years ago by shtrom

I confirm the need for better Message Carbons support in the case of OTR. At the moment, OTR messages from Pidgin are delivered to all clients (Gajim + Conversations in my case), and some notification noise ensues. Apparently due to carbons not being disabled for OTR messages at the sender [0]. There is some more rationale about preventing Carbon on OTR messages in the Conversations wiki [1].

[0] https://github.com/siacs/Conversations/issues/1275#issuecomment-123270047

[1] https://github.com/siacs/Conversations/blob/development/docs/observations.md#off-the-record

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

comment:44 Changed 2 years ago by Vermus

Any news? Cool feature (with MAM) for corporate jabber. Still using Gajim instead Pidgin.

comment:45 Changed 2 years ago by mmcco

It's being worked on by a GSoC student, Koosha. It should hopefully be merged this fall.

comment:46 Changed 2 years ago by marsjaninzmarsa

Nice timing - The Last Call of standardization ends on 2015-08-28. :D + CC.

comment:47 Changed 2 years ago by marsjaninzmarsa

Also, it will be in 3.0 or in 2.10.x?

comment:48 Changed 2 years ago by salinasv

Ticket #15663 has been marked as a duplicate of this ticket.

comment:49 Changed 2 years ago by salinasv

Just as an update, the GSoC project have applied this patch here: https://hg.pidgin.im/soc/2015/koosha/main/rev/9c71168e8a68

comment:50 Changed 2 years ago by ernierasta

Thanx salinasv for letting us know, and especially my gratitude goes to Koosha.

There is a chance, that after 3 years we will have patch incorporated in main line of Pidgin. ;-)

comment:51 Changed 2 years ago by andrey.utkin

Any plans on merging GSoC results?

comment:52 Changed 2 years ago by Robby

In an email from a few days salinasv said he'd reviewed the code.

comment:53 Changed 21 months ago by v1r0x

Any news on this?

comment:54 follow-up: Changed 21 months ago by salinasv

The code was reviewed. IIRC the carbons piece of it is ok, but the branch had some incomplete pieces so it can't be merged as is.

I think someone is looking into fixing the branch or cherry picking the carbon patches and apply them.

comment:55 in reply to: ↑ 54 Changed 21 months ago by EionRobb

Replying to salinasv:

The code was reviewed. IIRC the carbons piece of it is ok

No, because it still modifies the behaviour of serv_got_im()

comment:56 Changed 21 months ago by Robby

  • Milestone changed from Patches Needing Review to Patches Needing Improvement

In that case, I reckon the milestone was misleading?

comment:57 Changed 20 months ago by rsilvapt

Hi! I've downloaded the last version of the patch but don't know how to use it. Sorry, I'm a newbie. :)

Last edited 20 months ago by rsilvapt (previous) (diff)

comment:58 in reply to: ↑ 2 Changed 20 months ago by rsilvapt

Replying to xnyhps:

There was a security issue I missed in the patch (didn't properly check if the message came from your own JID, allowing anyone to fake carbon-messages). I've fixed it and cleaned up that code a bit.

Hi! I've downloaded the last version of the patch but don't know how to use it. Sorry, I'm a newbie. :)

comment:59 Changed 14 months ago by alexo

How does an end-user of Pidgin 2.11 enable carbons?

comment:60 Changed 8 months ago by _riba

I made a plugin for this XEP: https://github.com/gkdr/carbons Tell me how it works for you!

You can find me on IRC under the same username as here, and of course you can always open an issue on GitHub?.

comment:61 Changed 8 months ago by DreamFlasher

@_riba Thank you for your amazing work, that's extremely helpful! Really unfortunate that there seem to be no maintainers of Pidgin anymore.

comment:62 Changed 8 months ago by ernierasta

@_riba You are our hero!

I think, that is the only way to get some major new functionality to pidgin - via plugins. I do not know how plugins are chosen for official pidgin distribution, but maybe this can be included?

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!