hoehermann / purple-gowhatsapp

Pidgin/libpurple plugin for WhatsApp Web.
GNU General Public License v3.0
277 stars 34 forks source link

purple-whatsmeow: Unable to login with qrcode #104

Closed jeremyp3 closed 2 years ago

jeremyp3 commented 2 years ago

hello,

I am testing the whatsmeow branch but, I find that it is impossible to connect to whatsapp ...

when i scan the qrcode whatsapp reply me "please scan the qrcode again"

I tested with a blank pidgin, without any other plugins, same result. whatsapp does not want QRcode

pidgin version: 2.14.8 whatsapp version: 2.22.3.77

thanks for the help,

Jeremyp3

EionRobb commented 2 years ago

Have you turned on the multi-device beta in your settings? whatsmeow doesn't work with the non-multi way

jeremyp3 commented 2 years ago

activating the multi-device beta fixed the QRcode issue. thanks !

on the other hand, Now, I have an error message at the connection of the account:

Failed to send presence: can't send presence without PushName set

I see that the commit a097bcba talks about this push name, but I don't know if it can have something to do with my problem

thanks for help :)

Jeremyp3

hoehermann commented 2 years ago

That is weird. In this case, the PushName is your own name (as entered in WhatsApp on your phone). For some reasons, it was not transferred after the login via QR code. Now the plug-in does not know what name to use for sending messages. That is why it fails. Please go to Pidgin → Help → Error Messages → Filter for "whatsmeow" and re-connect. Are there any messages relating to the push name and or problems with the data storage?

jeremyp3 commented 2 years ago

log:

(22:13:02) account: Connecting to account ***@***.***
(22:13:02) connection: Connecting. gc = 0x5632dee16380
(22:13:02) whatsmeow: [Database] sqlite3 connecting to 
file:/home/jeremy/.purple/whatsmeow.db?_foreign_keys=on&_busy_timeout=3000
(22:13:02) whatsmeow: [Client/Socket] Dialing wss://web.whatsapp.com/ws/chat
(22:13:02) whatsmeow: [Client/Socket] Frame websocket read pump starting 
0x1c000163130
(22:13:03) whatsmeow: [Client/Recv] <success abprops="0" 
companion_enc_static="1JpTVPO/HWA8hr//P8rtT3z768GSEcK0Ip5Tp/M0Ixo=" 
creation="1644180015" location="cln" props="26" t="1644181983"/>
(22:13:03) whatsmeow: [Client] Successfully authenticated
(22:13:03) whatsmeow: [Client/Send] <iq id="195.146-1" 
to="s.whatsapp.net" type="get" xmlns="encrypt"><count/></iq>
(22:13:03) whatsmeow: [Client/Recv] <ib 
from="s.whatsapp.net"><edge_routing><routing_info>0809080b</routing_info></edge_routing></ib>
(22:13:03) whatsmeow: [Client/Recv] <ib from="s.whatsapp.net"><dirty 
timestamp="1644181983" type="account_sync"/></ib>
(22:13:03) whatsmeow: [Client/Recv] <iq from="s.whatsapp.net" 
id="195.146-1" type="result"><count value="49"/></iq>
(22:13:03) whatsmeow: [Client] Database has 49 prekeys, server says we 
have 49
(22:13:03) whatsmeow: [Client/Send] <iq id="195.146-2" 
to="s.whatsapp.net" type="set" xmlns="passive"><active/></iq>
(22:13:03) whatsmeow: [Client/Recv] <iq from="s.whatsapp.net" 
id="195.146-2" type="result"><active/></iq>
(22:13:03) whatsmeow: recieved connected (subtype 0) for account 
0x5632deac1540 remote (null) (isGroup 0) sender (null) (alias (null), 
fromMe 0) sent 0: (null)
(22:13:03) whatsmeow: recieved error (subtype 1) for account 
0x5632deac1540 remote (null) (isGroup 0) sender (null) (alias (null), 
fromMe 0) sent 0: Failed to send presence: can't send presence without 
PushName set
(22:13:03) connection: Connection error on 0x5632dee16380 (reason: 16 
description: Failed to send presence: can't send presence without 
PushName set)
(22:13:03) account: Disconnecting account ***@***.*** 
(0x5632deac1540)
(22:13:03) connection: Disconnecting connection 0x5632dee16380
(22:13:03) connection: Destroying connection 0x5632dee16380
(22:13:03) whatsmeow: [Handler/Profile] WhatsApp session disconnected. 
Profile picture downloader is shutting down.
(22:13:03) whatsmeow: [Client/Socket] Frame websocket read pump exiting 
0x1c000163130

I don't know if that helps

hoehermann commented 2 years ago

I can see nothing out of the ordinary. Can you remove the account from Pidgin and link again? I would like to see the debug output of the linking process.

jeremyp3 commented 2 years ago

debug log reconnect with qrcode: debug-pidgin.txt REDACTED FOR PRIVACY

hoehermann commented 2 years ago

Thank you for the test. The logs look good, but the problem still looks weird. The WhatsApp server send us a PairSuccess, yet the internal data store says PushName:"". To the plug-in, it looks like your name is not set on your phone. I cannot tell right now if I am not receiving the name or if the WhatsApp server doe never send it (that I could not change, obviously). I am leaving this bug report open as a reminder.

jeremyp3 commented 2 years ago

Hello,

I confirm that I have a name defined on whatsapp: "jeremyp". at the start, I had jeremyp3, but I thought it was the number that was causing him problems, so I only put "jeremyp"

do we talk about the name in the same place as where we can define a profile photo?

moreover, in order to be able to use the plugin, can't I have the sqlite query to be able to put a pushname so that he can connect?

thanks ! Jerem

hoehermann commented 2 years ago

I reproduced the problem. I want to keep you updated.

jeremyp3 commented 2 years ago

ok. no problem

thanks :)

hoehermann commented 2 years ago

I fixed it. I had changed a warning into an error not realizing that the login procedure takes a while. During that time the push name is not set, but Pidgin might already want to use the account. Updated binaries are available at the buildbot. Does it work now?

jeremyp3 commented 2 years ago

I confirm that it works. thanks!

afterwards, I have the impression that he shows me very little contact, but that's off topic in this thread

hoehermann commented 2 years ago

Good to hear it works. Thank you for your contribution. I was sloppy and did not run a test after changing the code. Your report is important to me since together we can test more. :)