@@ -46,8 +46,8 @@ class WhatsProt
4646 const WHATSAPP_SERVER = 's.whatsapp.net ' ; // The hostname used to login/send messages.
4747 const WHATSAPP_UPLOAD_HOST = 'https://mms.whatsapp.net/client/iphone/upload.php ' ; // The upload host.
4848 const WHATSAPP_DEVICE = 'Android ' ; // The device name.
49- const WHATSAPP_VER = '2.11.209 ' ; // The WhatsApp version.
50- const WHATSAPP_USER_AGENT = 'WhatsApp/2.11.209 Android/4.3 Device/GalaxyS3 ' ;// User agent used in request/registration code.
49+ const WHATSAPP_VER = '2.11.301 ' ; // The WhatsApp version.
50+ const WHATSAPP_USER_AGENT = 'WhatsApp/2.11.301 Android/4.3 Device/GalaxyS3 ' ;// User agent used in request/registration code.
5151
5252 /**
5353 * Property declarations.
@@ -1637,19 +1637,18 @@ protected function doLogin()
16371637 $ this ->sendNode ($ feat );
16381638 $ this ->sendNode ($ auth );
16391639
1640- $ this ->pollMessages ();
1641- $ cnt = 0 ;
1642- do {
1643- $ this ->pollMessages ();
1644- if ($ this ->challengeData != null ) {
1645- $ data = $ this ->createAuthResponseNode ();
1646- $ this ->sendNode ($ data );
1647- $ this ->reader ->setKey ($ this ->inputKey );
1648- $ this ->writer ->setKey ($ this ->outputKey );
1649- $ this ->pollMessages ();
1650- }
1651- } while ($ this ->challengeData == null && ($ cnt ++ < 100 ) && (strcmp ($ this ->loginStatus , static ::DISCONNECTED_STATUS ) == 0 ));
1652-
1640+ $ this ->pollMessage ();
1641+ $ this ->pollMessage ();
1642+ $ this ->pollMessage ();
1643+
1644+ if ($ this ->challengeData != null ) {
1645+ $ data = $ this ->createAuthResponseNode ();
1646+ $ this ->sendNode ($ data );
1647+ $ this ->reader ->setKey ($ this ->inputKey );
1648+ $ this ->writer ->setKey ($ this ->outputKey );
1649+ $ this ->pollMessage ();
1650+ }
1651+
16531652 if (strcmp ($ this ->loginStatus , static ::DISCONNECTED_STATUS ) == 0 )
16541653 {
16551654 throw new Exception ('Login Failure ' );
0 commit comments