Bug 64584 - OSCAR plugin tells you password is wrong, but does not prompt for re-entry
Summary: OSCAR plugin tells you password is wrong, but does not prompt for re-entry
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: ICQ and AIM Plugins (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: LO normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-20 08:33 UTC by Casey Allen Shobe
Modified: 2004-02-15 22:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Casey Allen Shobe 2003-09-20 08:33:05 UTC
Version:           20030919 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3.1 
OS:          Linux

If the password is set incorrectly and saved for an AIM account, you get a popup error when you try to connect telling you it was wrong.  You then have to go into the configuration to change it.  All of the other protocols will prompt you for the correct password, and so I think AIM should as well for consistancy and ease of use.
Comment 1 Casey Allen Shobe 2003-09-20 08:53:31 UTC
s/AIM/Oscar/ 
 
This applies to ICQ as well. 
Comment 2 Olivier Goffart 2003-09-21 10:21:00 UTC
Yes that's true, in that case you should call KopeteAccount::password(true) 
and try to reconnect. 
 
However, since there is a bug than sometimes my password is refused even if 
it's correct, and i just need to retry and that's work, it may be annoying. 
so it would be nice if you could fix this bug before 
 
 
 
Comment 3 Stefan Gehn 2003-09-21 10:33:18 UTC
Fix it yourself, it works here 
Comment 4 Casey Allen Shobe 2003-09-21 19:27:01 UTC
In current CVS, this still exists. 
 
To reproduce: 
1.  Set an AIM or ICQ account offline. 
2.  Go into the config and change the password to something random. 
3.  Save and try reconnecting. 
 
You'll get a popup which says "Sign on failed because the password supplied for 
this screen name is invalid. Please check your password and try again." 
 
This can be found in protocols/oscar/oscarsocket/oscarsocket.cpp on line 867.  
When case 5 occurs, the user should be prompted for his correct password to be 
consistant with the behavior of the other protocols. 
Comment 5 Stefan Gehn 2003-09-21 19:34:59 UTC
> However, since there is a bug than sometimes my password is refused even if  
> it's correct, and i just need to retry and that's work, it may be annoying.  
> so it would be nice if you could fix this bug before  
That was the actual part that has to be fixed by Olivier. 
 
I'll hopefully unify handling for the packet telling us about wrong passwords 
(currently this is done in two functions, one for AIM and one for ICQ although 
there's no need for that duplication). After that I can change the error and add 
something to retry login. 
Comment 6 Matt Rogers 2004-01-05 05:09:34 UTC
it's a bug, but not something i can get to before KDE 3.2
Comment 7 Matt Rogers 2004-02-13 00:52:40 UTC
setting back to normal. i keep missing it. ;(
Comment 8 Richard Smith 2004-02-15 22:34:47 UTC
CVS commit by lilachaze: 

Detect when the password is wrong, and try to reconnect.
CCMAIL: 64584-done@bugs.kde.org


  M +19 -2     oscaraccount.cpp   1.105
  M +5 -0      oscaraccount.h   1.50
  M +1 -1      aim/aimaccount.cpp   1.30
  M +1 -1      icq/icqaccount.cpp   1.39


--- kdenetwork/kopete/protocols/oscar/oscaraccount.cpp  #1.104:1.105
@@ -92,4 +92,6 @@ public:
         QMap<QString, AIMGroup *> groupNameMap;
         // -- END MERGED DATA FROM AIMBUDDYLIST ------------------------------
+
+        bool passwordWrong;
 };
 
@@ -110,4 +112,5 @@ OscarAccount::OscarAccount(KopeteProtoco
         d->lastIdleValue = 0;
         d->awayMessage = "";
+        d->passwordWrong = false;
 
         initEngine(isICQ); // Initialize the backend
@@ -191,4 +194,9 @@ void OscarAccount::disconnect()
 }
 
+bool OscarAccount::passwordWasWrong()
+{
+        return d->passwordWrong;
+}
+
 void OscarAccount::initEngine(bool icq)
 {
@@ -213,10 +221,17 @@ void OscarAccount::slotError(QString err
 
         // 1 = username unknown to server
-        // 5 = wrong password
-        if (errorCode == 1 || errorCode == 5 || errorCode == 24)
+        // 5 = wrong password for AIM
+        // 0 = wrong password for ICQ
+        if (errorCode == 1 || errorCode == 0 || errorCode == 5 || errorCode == 24)
                 OscarAccount::disconnect();
 
         KMessageBox::queuedMessageBox(Kopete::UI::Global::mainWidget(), KMessageBox::Error, errmsg,
                 i18n("Connection Lost - ICQ Plugin"), KMessageBox::Notify);
+
+        if (errorCode == 0 || errorCode == 5)
+        {
+                d->passwordWrong = true;
+                connect();
+        }
 }
 
@@ -394,4 +409,6 @@ void OscarAccount::slotLoggedIn()
         kdDebug(14150) << k_funcinfo << "Called" << endl;
 
+        d->passwordWrong = false;
+
         // Only call sync if we received a list on connect, does not happen on @mac AIM-accounts
         bool haveServerSideContacts = false;

--- kdenetwork/kopete/protocols/oscar/oscaraccount.h  #1.49:1.50
@@ -57,4 +57,9 @@ public:
 
         /*
+         * Was the password wrong last time we tried to connect?
+         */
+        bool passwordWasWrong();
+
+        /*
          * Sets the account away
          */

--- kdenetwork/kopete/protocols/oscar/aim/aimaccount.cpp  #1.29:1.30
@@ -251,5 +251,5 @@ void AIMAccount::connect(const unsigned 
         else if (screenName != i18n("(No Screen Name Set)") ) // FIXME: Is this needed at all?
         {
-                QString _password = password(false, 0L, 16);
+                QString _password = password(passwordWasWrong(), 0L, 16);
                 if (_password.isEmpty())
                 {

--- kdenetwork/kopete/protocols/oscar/icq/icqaccount.cpp  #1.38:1.39
@@ -151,5 +151,5 @@ void ICQAccount::connect(const unsigned 
         else if (screenName != i18n("(No Screen Name Set)") ) // FIXME: Is this needed at all?
         {
-                QString _password = password(false, 0L, 16);
+                QString _password = password(passwordWasWrong(), 0L, 8);
                 if (_password.isEmpty())
                 {