Bug 67287 - yahoo plugin goes offline without notification; status shown as online
Summary: yahoo plugin goes offline without notification; status shown as online
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Yahoo Plugin (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 67586 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-05 12:43 UTC by Amit Shah
Modified: 2005-11-17 09:22 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Yahoo protocol - keepalive patch (1.53 KB, patch)
2004-01-24 15:20 UTC, Sarah
Details
Sample session log (29.82 KB, text/plain)
2004-03-12 21:08 UTC, guillaume
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Shah 2003-11-05 12:43:02 UTC
Version:           0.7.3 (using KDE 3.1.4)
Installed from:     (testing/unstable)
Compiler:          gcc version 3.3.2 20030908 (Debian prerelease)
OS:          Linux (i686) release 2.6.0-test9

This started a couple of days back. Yahoo protocol goes offline, but the kopete window still shows it as online. The contacts available online at the time of disconnection are shown online. On disconnecting, quitting (don't know if this step is needed) and reconnecting, yahoo logs in again.

The messages sent in the window of actual disconnection and relogin are shown as offline messages.
Comment 1 Matt Rogers 2003-11-05 15:00:43 UTC
fixed in the 0.8 Beta. Implementing this was one of the first things that I did when CVS reopened after the 0.7 release.
Comment 2 Steven McDonald 2003-11-12 05:53:41 UTC
I'm still seeing this in CVS head from yesterday. It happens consistantly after I've been connected to yahoo for a while (though I don't know exactly how long it takes, I usually don't notice it's happened until someone logs off all other protocols and yahoo still thinks they're online)

Additionally, when I disconnect and try to reconnect Yahoo forgets my password (stored in the KDE wallet). If I go in to the account config and enter my password, it says it can't store it in the wallet and asks if I want to store unsafe. Then it asks again when I tell yahoo to connect.
Comment 3 Amit Shah 2003-11-12 06:13:07 UTC
Subject: Re:  yahoo plugin goes offline without notification; status shown as online

On Wednesday 12 Nov 2003 10:23, Steven McDonald wrote:
> ------- Additional Comments From scm@eds.org  2003-11-12 05:53 -------
> I'm still seeing this in CVS head from yesterday. It happens consistantly
> after I've been connected to yahoo for a while (though I don't know
> exactly how long it takes, I usually don't notice it's happened until
> someone logs off all other protocols and yahoo still thinks they're
> online)

yes; that's what happened to me too.

Also, today, msn, jabber protocols didn't connect and showed some message of 
them not being able to connect. Yahoo, however, showed that it had been 
connected (the icon was glowing), but no contacts were shown online. I 
disconnected yahoo and reconnected, this time it worked fine it went 
online. MSN, Jabber too went online in this try.

So the bug is: if yahoo isn't able to connect, it still sets its status to 
connected and doesn't give any message about not being able to make a 
connection, and also that it goes offline w/o any notification.

This sounds like two different bugs, but they may not be.

Comment 4 Steven McDonald 2003-11-12 23:02:44 UTC
Can this bug be reopened?

I'm still seeing this with 0.8 beta (CVS checkout from a few hours ago). I connect, and everything is fine at first, but after a while (an hour or two) another account/client confirms that yahoo is now offline, though it still appears to be online in Kopete. Is no one else seeing this in HEAD?

If there's any more information I can provide to help solve this, let me know. 
Comment 5 Amit Shah 2003-11-13 11:11:48 UTC
reopening since it has been confirmed with cvs head too
Comment 6 Amit Shah 2003-11-19 13:57:47 UTC
Subject: Re: yahoo plugin goes offline without notification; status shown as online

I just got disconnected w/o being notified, and didn't realize till I just 
kept sending messages and didn't receive any replies. Can we set the priority 
of this bug higher?

Comment 7 Amit Shah 2003-11-19 14:10:30 UTC
Subject: Re:  yahoo plugin goes offline without notification; status shown as online

btw, I'm using kopete from kde3.2beta1, compiled from konstruct.
Comment 8 Matt Rogers 2003-11-19 15:37:12 UTC
I haven't been able to take the time to reliably reproduce. I've only had it happen once so far. I'll try to do some testing later on tonight.
Comment 9 Sashmit Bhaduri 2003-11-20 04:46:56 UTC
I've been getting this the last few days as well (fresh cvs).. I can't find a way to reliably reproduce it however.
Comment 10 Matt Rogers 2003-11-25 05:51:04 UTC
*** Bug 67586 has been marked as a duplicate of this bug. ***
Comment 11 Matt Rogers 2003-11-25 06:12:29 UTC
will have a fix for this shortly. I can't provide any feedback other than turning the icon back to the greyed out color because of the string freeze, but it's better than nothing.
Comment 12 Amit Shah 2003-11-25 06:27:51 UTC
Subject: Re:  yahoo plugin goes offline without notification; status shown as online

On Tuesday 25 Nov 2003 10:42, you wrote:
> ------- will have a fix for this shortly. I can't provide any feedback
> other than turning the icon back to the greyed out color because of the
> string freeze, but it's better than nothing.

Yes; thanks. Also, the contacts which appear in the 'online' category will be 
moved to the 'offline' category, I guess.

Also, if this is of any help: On clicking 'connect all' or setting status to  
'available' on yahoo when it's offline, the icon is set to online immediately 
instead of displaying the glowing icon and the contacts shown online. This 
would mean that the yahoo plugin reports it's online even before it actually 
goes online.
Comment 13 Matt Rogers 2003-11-25 23:08:07 UTC
Subject: 
This should be fixed in CVS now.

Comment 14 Amit Shah 2003-12-11 10:46:06 UTC
Happened once more :-(

This time on kde3.2beta2.

Yahoo was offline all the time; I didn't realize till I was told by mail. MSN, Jabber, etc., are online and functional, though. Reopening the bug.

Selecting 'offline', and then 'online' (and then authenticating through kdewallet), the yahoo protocol went online and I got some offliners.
Comment 15 Amit Shah 2003-12-13 09:19:51 UTC
Our company 'net connection went down for some time. The MSN plugin immediately went offline. Yahoo still showed online. I manually set it to 'offline'; didn't wait to see if it got disconnected or not. There still is some problem with the yahoo plugin detecting activity.
Comment 16 Matt Rogers 2003-12-15 21:25:03 UTC
this would be the same problem as with the OSCAR protocol not detecting going offline either. Yahoo doesn't use any type of ping packets, so we won't know if we go offline or not immediately. I just had an idea of how to fix this, but I need to do some more research. 
Comment 17 Matt Rogers 2004-01-02 01:43:30 UTC
There have been some updates to CVS that might have fixed most of this bug. The issue with the net connection going down will need to fixed another way, but that should be the only case in which this happens.
Comment 18 Sarah 2004-01-24 15:20:12 UTC
Created attachment 4335 [details]
Yahoo protocol - keepalive patch

Kopete still has the same problem with Yahoo going offline without any
notification with CVS HEAD from about a week ago.

Ever since I made this little patch (which changes YahooSession::keepalive() to
a slot and sets up a QTimer to call it on a regular basis), the protocol hasn't
had any issues. (Used to be that I couldn't keep it connected for more than an
hour or so without having to reconnect, unless I was actually using it.)
Comment 19 Matt Rogers 2004-01-25 07:34:41 UTC
Subject: kdenetwork/kopete/protocols/yahoo

CVS commit by mattr: 

Use the patch from Sarah that's attached to bug 67287 to fix bug 67287

Thanks for the patch! :)

CCMAIL: 67287-done@bugs.kde.org
CCMAIL: sarah@b0rked.dhs.org


  M +7 -2      kyahoo.cpp   1.54
  M +3 -0      kyahoo.h   1.19


--- kdenetwork/kopete/protocols/yahoo/kyahoo.cpp  #1.53:1.54
@@ -24,4 +24,5 @@
 // QT Includes
 #include <qfile.h>
+#include <qtimer.h>
 
 // KDE Includes
@@ -139,5 +140,6 @@ YahooSession::YahooSession(int id, const
         m_Password = password;
         m_socket = 0L;
-        
+        m_keepalive = new QTimer(this, "keepaliveTimer");       
+        connect(m_keepalive, SIGNAL(timeout()), this, SLOT(keepalive()));
 }
 
@@ -155,4 +157,5 @@ void YahooSession::login(int initial)
         /* We try to login */
         yahoo_login( m_connId, initial );
+        m_keepalive->start(10000);
 }
 
@@ -176,4 +178,7 @@ void YahooSession::logOff()
         kdDebug(14181)<< k_funcinfo << " " << m_connId <<endl;
         yahoo_logoff( m_connId );
+        if (m_keepalive)
+                m_keepalive->stop();
+
         if ( m_socket ) 
         {

--- kdenetwork/kopete/protocols/yahoo/kyahoo.h  #1.18:1.19
@@ -82,5 +82,7 @@ public:
         void setIdentityStatus( const QString &identity, int active);
         void getList();
+public slots:
         void keepalive();
+public:
         void sendIm( const QString &from, const QString &who, const QString &msg);
         void sendTyping( const QString &from, const QString &who, int typ);
@@ -254,4 +256,5 @@ signals:
         QString m_BuddyListServer; // Buddy List server
         int m_BuddyListPort;
+        QTimer *m_keepalive;
 };
 


Comment 20 Amit Shah 2004-02-13 07:29:43 UTC
I'm running kde 3.2. I left kopete with the MSN, Jabber, ICQ, Yahoo plugins in the connected state overnight. When I checked in the morning, MSN was disconnected with some warning, so was Jabber. Yahoo was shown online.

I disconnected all and then reconnected, and all protocols came online again. The contacts that were shown online for Yahoo were not online this time, meaning that Yahoo had been disconnected without any warnings.. again.

I'm reopening this bug.
Comment 21 jstuart 2004-02-17 06:17:50 UTC

*** This bug has been marked as a duplicate of 71077 ***
Comment 22 Matt Rogers 2004-02-27 17:29:36 UTC
Not a duplicate of 71077

Comment 23 Matt Rogers 2004-02-29 06:04:53 UTC
Working on it...fix is in the testing stages.
Comment 24 Matt Rogers 2004-02-29 06:32:29 UTC
CVS commit by mattr: 

Fix bug 67287 by implementing a form of keepalive support for the Yahoo
plugin. This version expands on a patch attached to bug 67287 by using a 
method that checks for a response when the timer expires

CCMAIL: 67287@bugs.kde.org


  M +12 -2     kyahoo.cpp   1.58
  M +11 -3     kyahoo.h   1.23
  M +5 -2      yahooaccount.cpp   1.69


--- kdenetwork/kopete/protocols/yahoo/kyahoo.cpp  #1.57:1.58
@@ -140,6 +140,7 @@ YahooSession::YahooSession(int id, const
         m_Password = password;
         m_socket = 0L;
+        m_waitingForKeepalive = false;
         m_keepalive = new QTimer(this, "keepaliveTimer");
-        connect(m_keepalive, SIGNAL(timeout()), this, SLOT(keepalive()));
+        connect( m_keepalive, SIGNAL( timeout() ), this, SLOT( refresh() ) );
 }
 
@@ -193,5 +194,11 @@ void YahooSession::refresh()
 {
         kdDebug(14181) << k_funcinfo << endl;
+        if ( !m_waitingForKeepalive )
+        {
+                m_waitingForKeepalive = true;
         yahoo_refresh( m_connId );
+        }
+        else
+                emit error( "Disconnected." , 1 );
 }
 
@@ -1051,4 +1058,7 @@ void YahooSession::slotReadReady()
         kdDebug(14181) << k_funcinfo << "Socket FD: " << fd << endl;
 
+        if ( m_waitingForKeepalive )
+                m_waitingForKeepalive = false;
+
         ret = yahoo_read_ready( m_connId , fd, m_data );
 

--- kdenetwork/kopete/protocols/yahoo/kyahoo.h  #1.22:1.23
@@ -79,5 +79,5 @@ public:
         void login(int initial);
         void logOff();
-        void refresh();
+
         void setIdentityStatus( const QString &identity, int active);
         void getList();
@@ -84,4 +85,6 @@ public:
 public slots:
         void keepalive();
+        void refresh();
+
 public:
         void sendIm( const QString &from, const QString &who, const QString &msg);
@@ -238,9 +242,11 @@ signals:
         //void hostConnect(char *host, int port);
 
-        private slots:
+private slots:
+
         void slotLoginResponseReceiver( int succ, char *url);
         void slotReadReady();
         void slotWriteReady();
-        private:
+
+private:
         /* Private constructor */
         YahooSession(int id, const QString username, const QString password);
@@ -262,4 +268,6 @@ signals:
         int m_BuddyListPort;
         QTimer *m_keepalive;
+
+        bool m_waitingForKeepalive;
 };
 

--- kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp  #1.68:1.69
@@ -633,7 +633,10 @@ void YahooAccount::slotSystemMessage( co
 }
 
-void YahooAccount::slotError( const QString & /* err */, int /* fatal */ )
+void YahooAccount::slotError( const QString & err, int fatal )
 {
-//      kdDebug(14180) << k_funcinfo << endl;
+        Q_UNUSED( err );
+        kdDebug(14180) << k_funcinfo << endl;
+        if ( fatal == 1 )
+                disconnect();
 }
 


Comment 25 Matt Rogers 2004-02-29 06:44:14 UTC
CVS commit by mattr: 

Fix bug 67287 by implementing a form of keepalive support for the Yahoo
plugin. This version expands on a patch attached to bug 67287 by using a
method that checks for a response when the timer expires. It's a little
different from the HEAD version becaues the first patch for this bug
didn't make it into the stable branch.

CCMAIL: 67287-done@bugs.kde.org


  M +37 -24    kyahoo.cpp   1.53.2.1
  M +19 -10    kyahoo.h   1.18.4.1
  M +5 -2      yahooaccount.cpp   1.63.2.2


--- kdenetwork/kopete/protocols/yahoo/kyahoo.cpp  #1.53:1.53.2.1
@@ -24,4 +24,5 @@
 // QT Includes
 #include <qfile.h>
+#include <qtimer.h>
 
 // KDE Includes
@@ -139,4 +140,7 @@ YahooSession::YahooSession(int id, const
         m_Password = password;
         m_socket = 0L;
+        m_waitingForKeepalive = false;
+        m_keepalive = new QTimer( this, "keepaliveTimer" );
+        connect( m_keepalive, SIGNAL( timeout() ), this, SLOT( refresh() ) );
         
 }
@@ -188,5 +192,11 @@ void YahooSession::refresh()
 {
         kdDebug(14181) << k_funcinfo << endl;
+        if ( !m_waitingForKeepalive )
+        {
+                m_waitingForKeepalive = true;
         yahoo_refresh( m_connId );
+        }
+        else
+                emit error( "Disconnected." , 1 );
 }
 
@@ -1042,4 +1052,7 @@ void YahooSession::slotReadReady()
         kdDebug(14181) << k_funcinfo << "Socket FD: " << fd << endl;
 
+        if ( m_waitingForKeepalive )
+                m_waitingForKeepalive = false;
+
         ret = yahoo_read_ready( m_connId , fd, m_data );
 

--- kdenetwork/kopete/protocols/yahoo/kyahoo.h  #1.18:1.18.4.1
@@ -34,4 +34,5 @@ class YahooSession;
 class KExtendedSocket;
 class QSocketNotifier;
+class QTimer;
 
 /* Yahoo Protocol Connection Manager */
@@ -79,5 +80,4 @@ public:
         void login(int initial);
         void logOff();
-        void refresh();
         void setIdentityStatus( const QString &identity, int active);
         void getList();
@@ -135,4 +135,7 @@ public:
         int _hostAsyncConnectReceiver(char *host, int port,  yahoo_connect_callback callback, void *callback_data);
 
+public slots:
+        void refresh();
+
 signals:
         /**
@@ -231,9 +235,11 @@ signals:
         //void hostConnect(char *host, int port);
 
-        private slots:
+private slots:
+
         void slotLoginResponseReceiver( int succ, char *url);
         void slotReadReady();
         void slotWriteReady();
-        private:
+
+private:
         /* Private constructor */
         YahooSession(int id, const QString username, const QString password);
@@ -254,4 +260,7 @@ signals:
         QString m_BuddyListServer; // Buddy List server
         int m_BuddyListPort;
+        QTimer* m_keepalive;
+
+        bool m_waitingForKeepalive;
 };
 

--- kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp  #1.63.2.1:1.63.2.2
@@ -569,7 +569,10 @@ void YahooAccount::slotSystemMessage( co
 }
 
-void YahooAccount::slotError( const QString & /* err */, int /* fatal */ )
+void YahooAccount::slotError( const QString & err, int fatal )
 {
-//      kdDebug(14180) << k_funcinfo << endl;
+        Q_UNUSED( err );
+        kdDebug(14180) << k_funcinfo << endl;
+        if ( fatal == 1 )
+                disconnect();
 }
 


Comment 26 guillaume 2004-03-10 20:47:37 UTC
I still experience this bug with kopete shipped in kde 3.2.1 (Debian package). Is there anything I can provide to help you out ?

Guillaume
Comment 27 guillaume 2004-03-12 17:01:20 UTC
Ok, since nobody reponsded, I am going to post the whole thing :)

So again, this is Debian unstable KDE 3.2.1.

I can login and talk to Yahoo! just fine. After some inactivity time, my friends
see me disconnected, but kopete does not appear to know. It reports me as connected. I can still try to send IMs to my contacts but they don't receive them. 

If I logout and login, everything works.

Maybe, it would be good to reopen this bug...

Thanks,

Guillaume
Comment 28 Amit Shah 2004-03-12 17:08:31 UTC
On Friday 12 Mar 2004 21:31, guillaume@morinfr.org wrote:
> Maybe, it would be good to reopen this bug...

I will in some days if the developers don't acknowledge it (I'm the original 
reporter).

Comment 29 Amit Shah 2004-03-12 17:17:27 UTC
ah, just saw this: I was chatting with one of my friends when suddenly he messaged me on msn saying I logged out on yahoo. As seen earlier, I was logged in...
Comment 30 Amit Shah 2004-03-12 17:19:08 UTC
... I'm using Debian Sid 3.2.1 packages.

Comment 31 Matt Rogers 2004-03-12 17:21:51 UTC
For me to do anything else with this bug (which won't happen for at least two 
weeks since i'm going on vacation), I need debug output from the yahoo 
plugin, which means you'll have to compile kopete yourself. There are 
instructions at http://kopete.kde.org 

You people need more reliable connections. ;) 

Comment 32 Amit Shah 2004-03-12 17:39:19 UTC
On Friday 12 Mar 2004 21:52, Matt Rogers wrote:
> ------- For me to do anything else with this bug (which won't happen for at
> least two weeks since i'm going on vacation), I need debug output from the
> yahoo plugin, which means you'll have to compile kopete yourself. There are
> instructions at http://kopete.kde.org

okay, I'll try to get this done.

>
> You people need more reliable connections. ;)

Oh, and how to explain MSN sticking in there? Or are they really good at 
this ;-)

Comment 33 guillaume 2004-03-12 18:56:10 UTC
Dans un message du 12 mar 
Comment 34 guillaume 2004-03-12 21:07:50 UTC
Ok, I got it compiled and made a test session with all the symtoms. I am going to attach the log as a file since it is pretty long.
Comment 35 guillaume 2004-03-12 21:08:44 UTC
Created attachment 5194 [details]
Sample session log
Comment 36 Amit Shah 2004-03-13 06:42:39 UTC
On Saturday 13 Mar 2004 01:37, guillaume@morinfr.org wrote:
> ------- Ok, I got it compiled and made a test session with all the symtoms.
> I am going to attach the log as a file since it is pretty long.

Wow guillaume... that's a pretty detailed log :-)

Amazing that you could reproduce it easily.

Comment 37 Amit Shah 2004-03-15 15:25:13 UTC
... and I guess a reliable way to reproduce this would be to just plug out the ethernet cable (or switch the modem off) while being connected.
Comment 38 Matt Rogers 2004-03-21 06:50:44 UTC
CVS commit by mattr: 

I've made sure the keepalive code works in HEAD (which it does), and these
pieces of code are to help with the duplicate login bug. There is a two
minute delay before the yahoo protocol determines that it's been disconnected.
If after being disconnected for approximately two minutes, the yahoo protocol
still shows offline, please open a different bug.

For the duplicate login bug, I check to see if we've been disconnected by the
keepalive mechanism and suppress duplicate login warning (because it's not
really a duplicate login, the yahoo servers just don't think we've disconnected
yet)

Please note that this is the best way that I can think of within the limits of
the protocol. Yahoo is not nearly as accurate about detecting disconnects as
the MSN plugin is, and it's due to the way the YMSG protocol is designed.

(What a long commit message for so little code) :)

CCMAIL: 67287-done@bugs.kde.org
CCMAIL: 70311-done@bugs.kde.org


  M +3 -1      kyahoo.cpp   1.59
  M +8 -6      yahooaccount.cpp   1.70
  M +2 -0      yahooaccount.h   1.33


--- kdenetwork/kopete/protocols/yahoo/kyahoo.cpp  #1.58:1.59
@@ -200,5 +200,7 @@ void YahooSession::refresh()
         }
         else
-                emit error( "Disconnected." , 1 );
+        {       // use 2 for the value of fatal here because it's a keepalive disconnect
+                emit error( "Disconnected by keepalive." , 2 );
+        }
 }
 

--- kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp  #1.69:1.70
@@ -65,4 +65,5 @@ YahooAccount::YahooAccount(YahooProtocol
         theAwayDialog = new YahooAwayDialog( this );
         m_protocol = parent;
+        m_lastDisconnectCode = 0;
 
         setMyself( new YahooContact( this, accountId, accountId, 0 ) );
@@ -448,12 +449,13 @@ void YahooAccount::slotLoginResponse( in
         kdDebug(14180) << k_funcinfo << succ << ", " << url << ")]" << endl;
         QString errorMsg;
-        if (succ == YAHOO_LOGIN_OK)
+        if ( succ == YAHOO_LOGIN_OK || (succ == YAHOO_LOGIN_DUPL && m_lastDisconnectCode == 2) )
         {
                 slotGotBuddies(yahooSession()->getLegacyBuddyList());
-                /**
+                /*
                  * FIXME: Right now, we only support connecting as online
                  * Support needs to be added for invisible
                  */
                 static_cast<YahooContact *>( myself() )->setOnlineStatus( m_protocol->Online );
+                m_lastDisconnectCode = 0;
                 return;
         }
@@ -471,5 +473,5 @@ void YahooAccount::slotLoginResponse( in
                 return;
         }
-        else if(succ == YAHOO_LOGIN_DUPL)
+        else if ( succ == YAHOO_LOGIN_DUPL && m_lastDisconnectCode != 2 )
         {
                 errorMsg = i18n("You have been logged out of the yahoo service, possibly due to a duplicate login.");
@@ -635,7 +637,7 @@ void YahooAccount::slotSystemMessage( co
 void YahooAccount::slotError( const QString & err, int fatal )
 {
-        Q_UNUSED( err );
-        kdDebug(14180) << k_funcinfo << endl;
-        if ( fatal == 1 )
+        kdDebug(14180) << k_funcinfo << err << endl;
+        m_lastDisconnectCode = fatal;
+        if ( fatal == 1 || fatal == 2 )
                 disconnect();
 }

--- kdenetwork/kopete/protocols/yahoo/yahooaccount.h  #1.32:1.33
@@ -200,4 +200,5 @@ private:
         bool m_importContacts;          // Import the contacts from the server
         int m_sessionId;                // The Yahoo session descriptor
+        int m_lastDisconnectCode;       // The last disconnect code.
         YahooSession *m_session;        // Connection Object
         YahooProtocol *m_protocol;      // The Protocol Object


Comment 39 Stefano 2004-05-18 09:44:44 UTC
i've got the same problem as guillaume on kde 3.2.2 with kopete 8.2 on gentoo linux

after a bit of time not chatting my freinds see me offline, while kopete still reporting online, and I'm no able to receive any message nor to send them until I disconnect manually and reconnect.

So is this bug closed or not?
Comment 40 Matt Rogers 2004-05-18 17:09:39 UTC
It's fixed in HEAD. If i find time, I'll backport for the KDE 3.2.3 (or KDE 3.2.4, I don't remember which one is next or how close they are). I wanted to make sure it's stable first before backporting.
Comment 41 Andrew Corrigan 2005-03-19 19:10:44 UTC
Just had this happen with Kopete from KDE 3.4.0 (using Arch Linux)
Comment 42 m.wege 2005-03-22 10:18:14 UTC
I have this since a few days with KDE 3.3.2. I get shut out after a minute or sometimes I can not even get logged in. But I have hint for this behaviour: When I can not initially log in I am notified this may be because I am already logged. This is definitely not the case (not login via browser), but may be this has something to do that I am in a network of a students house. So that others are logged in from the same IP. So I do not know if this is something which can be changed by Kopete. But I thought it may be still worth reporting it.
Comment 43 Andrew Corrigan 2005-07-28 22:53:30 UTC
I don't want to be annoying but I want to use Kopete.  And since I just saw KDE 3.4.2 was released and no mention of this is in the changelog and I'm still having the problem in 3.4.1, I'm wondering what I can do to help get this fixed.
Comment 44 Casey Allen Shobe 2005-07-28 23:48:42 UTC
Yes, this bug persists in the Kopete included in KDE 3.4.1, 3.4.0, and the last 3.3.x I used too.  I constantly disconnect and reconnect from Yahoo several times a day to be on the safe side, and oftentimes immediately get a bunch of offline messages.  Kopete doesn't error when I send messages to contacts shown as online when I send them, and they sometimes do get my messages, but they see me as offline, and their messages don't reach me.
Comment 45 Casey Allen Shobe 2005-07-29 02:15:01 UTC
On Thursday 28 July 2005 23:47, Matt Rogers wrote:
>            What    |Removed                     |Added
> -----------------------------------------------------------------
>----------- Severity|major                       |normal


Umm, in what way is this not a major bug?  It's certainly more 
critical than broken extra features like links not showing up as 
links - it makes Kopete borderline unusable for Yahoo.
Comment 46 Thomas Vollmer 2005-07-29 10:43:55 UTC
I also still see this in trunk or more recent in 3.5 branch
Comment 47 Matt Rogers 2005-08-12 05:01:31 UTC
regarding the status of this bug as normal and not major: So far, I have not seen a reliable way to reproduce this in its current form. I also imagine that it will be hard to reproduce at will. Because of the lack of consistent reproducibility, I can't justify making this a marking this as a major bug. 

However, if a set of reproduction instructions is supplied, or the maintainer of the plugin can reproduce this reliably (i'm no longer the maintainer of the yahoo plugin), then i'll be more than happy to bump it to major. 
Comment 48 Andre Duffeck 2005-08-14 17:23:26 UTC
SVN commit 449162 by duffeck:

Detect disconnects (after 1-2 minutes).
Modified version of Matt's patch.
BUG:67287


 M  +11 -4     kyahoo.cpp  
 M  +1 -0      kyahoo.h  
 M  +15 -3     yahooaccount.cpp  
 M  +3 -0      yahooaccount.h  


--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/kyahoo.cpp #449161:449162
@@ -105,7 +105,7 @@
 		dev = ( *it )->socketDevice();
 		if ( dev->socket() == fd )
 		{
-			kdDebug(14181) << k_funcinfo << "Found socket" << endl;
+			//kdDebug(14181) << k_funcinfo << "Found socket" << endl;
 			KStreamSocket* socket = ( *it );
 			return socket;
 		}
@@ -228,8 +228,9 @@
 	m_Password = password;
 	m_lastWebcamTimestamp = 0;
 	currentImage = 0L;
+	m_waitingForResponse = false;
 	m_iconLoader = new YahooBuddyIconLoader();
-
+	
 	connect( m_iconLoader, SIGNAL(fetchedBuddyIcon(const QString&, KTempFile*, int )), this, SLOT(slotBuddyIconFetched(const QString&, KTempFile*,  int ) ) );
 }
 
@@ -273,7 +274,11 @@
 
 void YahooSession::refresh()
 {
-	kdDebug(14181) << k_funcinfo << endl;
+	kdDebug(14181) << k_funcinfo << endl;	
+	if( m_waitingForResponse ){
+		emit error( QString("Connection timed out."), 1 );			// previous ping packet wasn't sent --> we are probably disconnected
+	}
+	m_waitingForResponse = true;
 	yahoo_refresh( m_connId );
 }
 
@@ -291,7 +296,8 @@
 
 void YahooSession::keepalive()
 {
-	kdDebug(14181) << k_funcinfo << endl;
+	kdDebug(14181) << k_funcinfo << "Sending keepalive packet." << endl;
+
 	yahoo_keepalive( m_connId );
 }
 
@@ -1261,6 +1267,7 @@
 void YahooSession::_statusChangedReceiver( char *who, int stat, char *msg, int away )
 {
 //	kdDebug(14181) << k_funcinfo << endl;
+	m_waitingForResponse = false;
 
 	emit statusChanged( QString::fromLocal8Bit( who ), stat, QString::fromLocal8Bit( msg ), away );
 }
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/kyahoo.h #449161:449162
@@ -353,6 +353,7 @@
 	int m_Status;
 	int m_connId;
 	int m_fd;
+	bool m_waitingForResponse;
 
 	QString m_BuddyListServer; // Buddy List server
 	int m_BuddyListPort;
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp #449161:449162
@@ -24,6 +24,7 @@
 #include <qcolor.h>
 #include <qregexp.h>
 #include <qimage.h>
+#include <qtimer.h>
 
 // KDE
 #include <klocale.h>
@@ -78,6 +79,7 @@
 	m_lastDisconnectCode = 0;
 	m_currentMailCount = 0;
 	m_pictureFlag = 0;
+	m_keepaliveTimer = new QTimer( this, "keepaliveTimer" );
 
 	YahooContact* _myself=new YahooContact( this, accountId, accountId, Kopete::ContactList::self()->myself() );
 	setMyself( _myself );
@@ -88,6 +90,7 @@
 	myself()->setProperty( YahooProtocol::protocol()->iconExpire, configGroup()->readNumEntry( "iconExpire", 0 ) );
 	
 	QObject::connect( Kopete::ContactList::self(), SIGNAL( globalIdentityChanged(const QString&, const QVariant& ) ), SLOT( slotGlobalIdentityChanged(const QString&, const QVariant& ) ));
+	QObject::connect( m_keepaliveTimer, SIGNAL( timeout() ), this, SLOT( slotKeepalive() ) );
 
 	QString displayName = configGroup()->readEntry(QString::fromLatin1("displayName"));
 	if(!displayName.isEmpty())
@@ -434,6 +437,7 @@
 		for ( QDictIterator<Kopete::Contact> i( contacts() ); i.current(); ++i )
 			static_cast<YahooContact *>( i.current() )->setOnlineStatus( m_protocol->Offline );
 		
+		m_keepaliveTimer->stop();
 		disconnected( Manual );
 	}
 	else
@@ -448,6 +452,12 @@
 	theHaveContactList = false;
 }
 
+void YahooAccount::slotKeepalive()
+{
+	if( isConnected() && m_session )
+		m_session->refresh();
+}
+
 void YahooAccount::setAway(bool status, const QString &awayMessage)
 {
 	kdDebug(14180) << k_funcinfo << endl;
@@ -569,6 +579,7 @@
 		 
 		setBuddyIcon( myself()->property( Kopete::Global::Properties::self()->photo() ).value().toString() );
 		m_lastDisconnectCode = 0;
+		m_keepaliveTimer->start( 60 * 1000 );
 		return;
 	}
 	else if(succ == YAHOO_LOGIN_PASSWD)
@@ -634,7 +645,7 @@
 
 void YahooAccount::slotStatusChanged( const QString &who, int stat, const QString &msg, int  away )
 {
-//	kdDebug(14180) << k_funcinfo << endl;
+	//kdDebug(14180) << k_funcinfo << endl;
 	Kopete::Contact *kc = contact( who );
 	
 	if( contact( who ) == myself() )
@@ -848,10 +859,12 @@
 //	kdDebug(14180) << k_funcinfo << msg << endl;
 }
 
-void YahooAccount::slotError( const QString & err, int fatal )
+void YahooAccount::slotError( const QString &err, int fatal )
 {
 	kdDebug(14180) << k_funcinfo << err << endl;
 	m_lastDisconnectCode = fatal;
+	KMessageBox::error( Kopete::UI::Global::mainWidget(), i18n( "<qt>The connection with the Yahoo server was lost.</qt>" ), 
+							i18n( "Connection Lost - Yahoo Plugin" ) );
 	if ( fatal == 1 || fatal == 2 || fatal == -1 )
 		disconnect();
 }
@@ -883,7 +896,6 @@
 
 void YahooAccount::slotGotBuddyIconChecksum(const QString &who, int checksum)
 {
-	kdDebug(14180) << k_funcinfo << endl;
 	YahooContact *kc = contact( who );
 	if ( kc == NULL ) {
 		kdDebug(14180) << k_funcinfo << "contact " << who << " doesn't exist." << endl;
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/yahooaccount.h #449161:449162
@@ -39,6 +39,7 @@
 class YahooAccount;
 class YahooProtocol;
 class KTempFile;
+class QTimer;
 struct KURL;
 
 class YahooAwayDialog : public KopeteAwayDialog
@@ -201,6 +202,7 @@
 	 * When a global identity key get changed.
 	 */
 	void slotGlobalIdentityChanged( const QString &key, const QVariant &value );
+	void slotKeepalive();
 private:
 
 	/**
@@ -223,6 +225,7 @@
 
 	bool theHaveContactList;	// Do we have the full server-side contact list yet?
 	int stateOnConnection;		// The state to change to on connection
+	QTimer* m_keepaliveTimer;
 
 	/**
 	 * External Settings and Descriptors
Comment 49 Casey Allen Shobe 2005-10-31 00:52:35 UTC
Still broken in 3.4.92.  Now it shows up as status: Busy every time it breaks, so at least I can tell that it's broken, but every single day when I wake up, or coma back from an outing, it's broken.  It shows the Yahoo contacts in their last known state (which is usually wrong and changes as soon as I reconnect), and never succeeds to change my status back to online.

If I change my status manually to Online, it pretends to work (the icon changes), but nothing happens.  I have to go offline then back on to make things actually work.
Comment 50 Andre Duffeck 2005-10-31 08:11:24 UTC
What is the kopete-version? 3.4.92 is your KDE version.
Comment 51 Peter Bailey 2005-11-14 11:10:41 UTC
I have two clients with another account logged in and I can see that my Kopete account disconnects and completely lacks any report of it.

Changing status to offline and back brings me back online, but other status changes don't do anything.
Comment 52 Andre Duffeck 2005-11-14 12:30:22 UTC
what kopete version do you use?
Comment 53 Peter Bailey 2005-11-16 05:59:02 UTC
Currently using the Debian unstable package:

Debian: kopete_3.3.2-5_i386.deb
About Kopete: 0.10.3 w/ KDE 3.4.2
Comment 54 Andre Duffeck 2005-11-16 08:41:26 UTC
That was fixed in kopete 0.11. Please update.

I will close this bug again as i guess that Casey also uses a older version of kopete. If I'm wrong please reopen again.
Comment 55 Casey Allen Shobe 2005-11-16 22:44:58 UTC
No, I'm using 0.11 beta 1 and beta 2.  Upon further testing, the bug appears lessened in beta 2, though the symptoms are still there.

When I come back from being auto-away, the Kopete tray icon still shows my status as away, and when I bring up the kopete window, all protocols are online, except the Yahoo ones, which are marked as Busy.  This is exactly what happened before, except that I was really offline.  Now I'm not sure what my real Yahoo status is, but people can message me, and I can manually change it to online (not sure if that actually does anything).

It is better, anyways.
Comment 56 Andre Duffeck 2005-11-17 09:22:19 UTC
yes, that's a different problem and was fixed shortly before KDE 3.5 RC1, so it should behave as expected there.