hoehermann / purple-gowhatsapp

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

QR code required on every connection (session not stored) #115

Closed blacklight closed 2 years ago

blacklight commented 2 years ago

I bumped into this issue earlier already, and back then it got fixed by a PR and a setting (restore-session = true). However, after migrating to whatsmeow the issue is back (QR code is required on every connection), and the restore-session setting is also gone. Is it something you guys are aware of or am I missing something in the setup?

hoehermann commented 2 years ago

Oh, yes. For enabling bitlbee-compatible storage mechanisms, the setting bridge-compatibility must be enabled. Please let me know if that helps. In case bridge-compatibility has unwanted effects, please also let me know. vitalyster mentioned some issues with spectrum but did not elaborate.

PS: I should probably write a migration manual and mention it there.

rvdborgt commented 2 years ago

PS: I should probably write a migration manual and mention it there.

That would be greatly appreciated :) I was just wondering what I have to do to migrate.

blacklight commented 2 years ago

For enabling bitlbee-compatible storage mechanisms, the setting bridge-compatibility must be enabled

Thanks, that did the trick! Is there a reason why this flag isn't enabled by default?

hoehermann commented 2 years ago

Yes. Firing a bitlbee-specific signal crashes Pidgin's debug view, see https://github.com/hoehermann/purple-gowhatsapp/issues/105#issuecomment-1032038677. I read through Pidgin's code and have not seen a way to overcome this programmatically.

EionRobb commented 2 years ago

You could look at what UI is running libpurple and set the flag automatically?

if (g_strcmp0(purple_core_get_ui(), "BitlBee") == 0) {
    purple_account_set_bool(account, "bridge-compatibility", TRUE);
}
hoehermann commented 2 years ago

That is a good idea. I was so focused on accessing instance_table (signals.c) directly that I forgot I could also check for BitlBee.

Just now I noticed I can also try purple_signal_get_values to check whether the signal itself has been registered. It is just a shot in the dark and I did not test it at all. Feel free to give 6009ffa from the https://github.com/hoehermann/purple-gowhatsapp/tree/dev branch a try.

Thank you for your help, both of you. :heart:

hoehermann commented 2 years ago

@BlackLight Did you have the chance to test the dev branch against Bitlbee?

blacklight commented 2 years ago

Did you have the chance to test the dev branch against Bitlbee?

In my case the bridge-compatibility option already did the trick.

hoehermann commented 2 years ago

Okay. In that case, I just hope my recent changes did not break anything. For now, I guess this is fixed. :)