gkdr / carbons

Experimental XEP-0280: Message Carbons plugin for libpurple (Pidgin, Finch, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weird interaction with "psychic" plugin

mightyBroccoli opened this issue · comments

commented

I don't know if I am explaining this issue right but I hope somebody can understand.

I am using carbons on 2 clients. It works fine but everytime I send stuff on client A on client B two windows pops up. Firstly my message to the recipient of my message and secondly my own account with user started typing and nothing more. But this window appears everytime on the other client.
This is not correct right?

Well, it would help if you name those two clients :D
To implement this XEP, nothing is done to sent messages - it is the server which has to decide which are eligible for carbons and then send them to the respective clients. The specification suggests not forwarding messages which do not contain a body (such as a typing notification), but yours seems to do that, which might be the issue.

commented

ok first my client 10 clientA is logged in with to ressources

  1. Pidgin Win 10
  2. Pidgin Arch Linux

Both with the latest carbons plugin.

When I now text from Pidgin Win10 to clientB the other client on arch linux shows this message that is was carbons is about. But I also get clientA as chat window with nothing in it except has stopped typing

Sorry, I still don't quite understand. Let me try to put it in my own words:
You are logged in from two Pidgin clients A1 and A2 which both use this plugin, and send a message from A1 to someone else using client B.
On A2, you not only see the message you sent from A1 to B, but another window with A1 (i.e. yourself) pops up which just says "A1 stopped typing".

Is that correct?

commented

I think this is correct yes.
I think the window on A2 pops up when I start typing but normally I see it when I stopped typing. But just this "status message" is displayed nothing else.

I have never had that happen, so as I said before I think it is because your server forwards those typing notifications too.
I'm gonna see what I can do to filter that out (in general, messages without a message body that come from your own account can probably be dropped...).

commented

That would be awesome. Your plugin works totally great and does what it should do just this little thing is a little bugging.
I will test the upcoming version and will report back to you. Thank you :)

The funny thing is: I actually added the exact same thing I'd have to filter now in the last release, but I really can't remember what it fixed.
(There is not ticket either, so probably someone talked to me on IRC about it...)

Can you maybe check out the commit before the current one (0bc6a5c) and tell me if it fixed your issue without adding others?

commented

How do i download the specific commit. I did not compile it by myself i just downloaded the dll file.

Maybe I misunderstood you after all.
Are you using Pidgin+Win10 on both A1 and A2, and only B uses Pidgin+Arch?

Edit: I'll go to my Windows PC and try to reproduce it there. I somehow broke my Pidgin, but I can't reproduce the error using Finch + Gajim both on Linux.

commented

yes i am using pidgin win10 and pidgin arch linux but i did not compile it myself there is an aur package which does that for me AUR libpurple-carbons-git

I see. Well, then let me try to reproduce this on my own first.

commented

ok sure

It just doesn't happen for me (xubuntu, fedora). Does it only happen on Windows, or also on Arch?
I'll come up with some more debug output that might help.

commented
<iq id='purple38f692bf' type='result' to='broccoli@magicbroccoli.de/win10'/>
<message type='chat' to='jack@magicbroccoli.de/cookies' from='broccoli@magicbroccoli.de/arch' id='purpleba6f85d7'>
	<composing xmlns='http://jabber.org/protocol/chatstates'/>
</message>
<message type='chat' to='jack@magicbroccoli.de/cookies' from='broccoli@magicbroccoli.de/arch' id='purpleba6f85d8'>
	<paused xmlns='http://jabber.org/protocol/chatstates'/>
</message>

I get this behaviour on both systems. I just started typing on arch and the window pops up I dont even have to send i just need to start typing. I works in both ways starting typing on win10 and the window pops up on arch and the other way around.

I just remembered which messages I un-filtered by allowing messages with no body: <encrypted> OMEMO messages! So I definitely can filter out those chatstate messages (but I fear you'll have to wait until tomorrow).
I wonder why I can't reproduce it though, are you on Pidgin 2.11.0?

commented

sure dude that is awesome I am happy that I could reach you and talk to you about that :)
yes I am using 2.11.0 on both devices. Why isn't that the latest version? Or am I missing something?

No, I am just trying to figure out why I can't reproduce it. I'm on 2.11.0 too.
I just noticed something though: Did the messages not come in a carbons-wrapper like in the examples in section 7 and 8 of the (XEP)[https://xmpp.org/extensions/xep-0280.html]?
I'm not sure why one client DIRECTLY sends the other client this chatstate message, it should go to the other person and you should only receive a copy (but this copy is in a carbon wrapper and sent by your bare JID with no resource).

Edit:
If you clone this repo (git clone https://github.com/gkdr/carbons.git) and then cd into the directory you can check out the older commit which ignores all messages that have no body by typing git checkout ec493a1a880611b9c7ce0b262c28f4d12f1cb264 -b master. If you then type make install it will build the plugin and put it in your plugin dir (you should have the dependencies from installing the AUR package).
If that helps, it's my fault, if it doesn't, it's not :D

commented
<message type='chat' to='jack@magicbroccoli.de' from='broccoli@magicbroccoli.de/arch' id='purplebb27ba26'>
	<composing xmlns='http://jabber.org/protocol/chatstates'/>
</message>
<message type='chat' to='jack@magicbroccoli.de' from='broccoli@magicbroccoli.de/arch' id='purplebb27ba27'>
	<paused xmlns='http://jabber.org/protocol/chatstates'/>
</message>

I get the same error when I am using the self compiled special version you pointed out.
it all worked perfectly no compiler errors or stuff or pidgin errors but when i start typing on arch/ win i get the window of myself typing on the other.

Are you 100% sure these are carbons messages? I.E. they disappear if you type /carbons off or deactivate the plugin?
Because this plugin does not modify outgoing messages or send any messages by itself (as the server does the copying later).
And carbons messages would look more like this:

<message to='you@example.com/currentresource' from='you@example.com' >
    <sent xmlns='urn:xmpp:carbons:2'>
        <forwarded xmlns='urn:xmpp:forward:0'>
            <message to='you@example.com/otherresource' from='otherguy@example.com'>
                <composing xmlns='http://jabber.org/protocol/chatstates'/>
            </message>
        </forwarded>
    </sent>
</message>

I'm not sure if you're just simplifying it for the sake of brevity and only copying the inside part or if there is something weird going on.
Because if you are just copying the inside part... it's weird that you are sending a typing notification to yourself.

The only other thing I can think of is that your server uses some old version of carbons.

commented

I am 100% sure. I tried turning carbons off on client A1 and the window still pops up on client A2 and the other way around. The window does not pop up if I deactivate the plugin on both clients.

I am not sure what is going on. Pidgin supports this conversation notivication if somebody starts typing you a message that the chat window pops up even befor the message is fully typed, but I thought just for other ppl and not myself.
I am not simplifying this issue. I just use your plugin and the problem is occuring.
I am using the raw xmpp log for this.
I am using prosody 0.9.12 with the carbons module prosody module carbons

I am using the same server with the same plugin for testing, so that shouldn't be it.
I really don't know why you get these messages, because all carbons messages should have that XML tag with the carbons namespace in it.
So you have the "Psychic Mode" plugin turned on? If so, I could look what it filters for.

commented

yes i have that turned on with just the last setting activated that i will get messaged inside the chat window nothing more.
I am completely clueless why this is happening that is why I am asking :/

I'll try to find out why that happens.

commented

So I am not completely insane :D good to know :D
If you have specific tasks for me to perform to get more infos or stuff just ask me :)

I think I found a very simple solution to this - in the plugin options of the "psychic mode" plugin, select Only enable for users on the buddy list.
Would that be enough?

commented

Yes this solution works. It's a bit edgy because the functionality is a little damaged but I think that's ok the carbons function is way more useful then knowing when some random person is typing a message to me.
Perhaps this issue gets fixed randomly in the future.

The thing is, according to the XEP, the carbon-copying of chat states (this includes the "composing" chat state which causes these problems) is explicitly included.

If I ignore them to make this plugin interact better with the "psychic" plugin, I am going against the specification.
I'll see if I can reach someone about it - I think it's the other plugin that should be fixed.

commented

oh ok if it is within the specifications of the XEP, I think that the psychic plugin is kinda broken for this XEP. But the plugin is maintained by Pidgin and Pidgin itself does not support carbons. I think that they didn't thought about that.

But the plugin is maintained by Pidgin and Pidgin itself does not support carbons.

I believe, that plugin is maintained by Christopher O'Brien and only bundled with Pidgin. And its bug in "psychic" plugin. And we can provide patch, worst case. And user can install patched version anyway. So you only may have trouble with pushing patch upstream (that means waiting for next point release).

commented

ok i guess this issue is closed then. We figured out it is not in out jurisdiction to get the problem lets wait for pidgin or Christopher O'Brien or both what ever to fix this fix this mess :D

I would suggest keeping issue open for reference, or add info about it to "Know issues" or so. But this is @gkdr choice, I think.

I forgot: any tracking for bug in side/upstream?

I agree this should be tracked, and will re-open this issue.

I briefly mentioned this issue on IRC, and seeing as there was no consensus on which part needs to be patched, there was also no progress, so I opened a ticket over at the Pidgin bug tracker.
You can find it here: https://developer.pidgin.im/ticket/17195

I'm experiencing this issue without the psychic module enabled. Pretty much the same setup as the OP.

I get "XXX is typing ..." on multiple devices but only one device receives the actual messages from the other user.