hoehermann / purple-gowhatsapp

Pidgin/libpurple plug-in for WhatsApp Web.
GNU General Public License v3.0
283 stars 35 forks source link

Group chats don't show who is saying what #26

Closed brianjmurrell closed 3 years ago

brianjmurrell commented 5 years ago

In a group chat, everything said is reported as coming from the group name, not the name of the person in the group that said what was said.

I am sure you could imagine how difficult that makes following group chats.

hoehermann commented 5 years ago

I know. I never figured out how to do group chats. Pidgin keeps crashing on me. My other plug-in has the same known deficit. :( However, as I myself do not engage in large group conversations, this missing feature still is in a state of "works for me". Maybe, one day, I want to find out how to do group chats. Until then, this is up to someone else to look at.

brianjmurrell commented 5 years ago

After a very brief look at the code (and zero experience/history of working with purple) (i.e. so this is a SWAG), is this where an incoming message is given to purple to be displayed by pidgin? https://github.com/hoehermann/purple-gowhatsapp/blob/6d997ae16fdbb7213e5fe3d6fda07e46e70333a4/libgowhatsapp.c#L214

And if so, is gwamsg->remoteJid the "sender" of the message, to be displayed by pidgin?

And if so (again), I guess that would need to be converted to the real sender in the group, not the group itself.

hoehermann commented 5 years ago

You are somewhat on the right track. remoteJid identifies the conversation (which may be a one-to-one chat or a group chat). In case of a group chat, senderJid identifies the participant (the actual "sender").

However, in purple group chats and one-to-one chats are fundamentally different. Most notably, group chats are identified by a numeric id, but in WhatsApp remoteJid is a string. In Pidgin, group chats do not have a name, but a title. It looks like you need to define who is yourself within the group chat. Apparently, I failed to do it correctly. You can look at what I tried at libpurple-signald. Feel free to do your own experiments.

For a quick and dirty "solution", you could change the line to something like

char *content = g_strdup_printf("%s says %s", gwamsg->senderJid, gwamsg->text);
purple_serv_got_im(pc, gwamsg->remoteJid, , flags, gwamsg->timestamp);
g_free(content);

.

hoehermann commented 4 years ago

@brianjmurrell Version 0.3.2 includes the additions of commit 09d8608. Group chats are still no proper group chats, but the participant's number (or name/alias, if you added them to Pidgin's buddy list) should be displayed. I hope this helps.

brianjmurrell commented 4 years ago

@hoehermann I just noticed this as I was confirming the fix in #61 was fixing #38 also.

I can confirm, I do see the identity of the group member sending each message, so this is a huge step up.

Could you expand on:

Group chats are still no proper group chats

?

Just wondering what they are missing.

hoehermann commented 4 years ago

I just noticed this as I was confirming the fix in #61 was fixing #38 also.

That is wonderful news. Thank you.

Just wondering what they are missing.

Proper Pidgin chats show the full list of participants. Also, you can join and leave them.

But implementing group chats properly is quite tedious, as I learned from my other plug-in purple-signald. As a result, I consider the current state "90% there, works for me" and I want to keep it this way for now. :)

brianjmurrell commented 4 years ago

That is wonderful news. Thank you.

Well, I haven't actually confirmed it yet. I've only been running with the latest master for a day or two now. Even before the memory management fixes I could run for several days without a crash. So it's a bit soon to declare victory yet.

brianjmurrell commented 4 years ago

Proper Pidgin chats show the full list of participants. Also, you can join and leave them.

Ah, yes. I hadn't noticed that was lacking.

luqven commented 3 years ago

I realize this is a big ask, but if @EionRobb could be so kind as to either:

I'd be happy to help building those, just don't have much experience with .dll and makefiles.

hoehermann commented 3 years ago

Nightly builds are are available at https://buildbot.hehoe.de/purple-gowhatsapp/builds/?C=M;O=D. This also automatically releases new versions if go-whatsapp (library included) is updated.

I am closing this as I think the original issue has been fixed. Feel free to re-open.