[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenetwork/kopete/protocols/yahoo
From:       Matt Rogers <mattr () kde ! org>
Date:       2005-04-02 4:26:04
Message-ID: 20050402042604.F2A64490 () office ! kde ! org
[Download RAW message or body]

CVS commit by mattr: 

Make sure to not create a new session before we actually we want to connect.
Otherwise, we override the correct session that's already connected, which
is what leads to being able to receive but not send messages.

BUG: 102274


  M +28 -25    yahooaccount.cpp   1.116


--- kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp  #1.115:1.116
@@ -300,4 +300,18 @@ void YahooAccount::initConnectionSignals
 void YahooAccount::connectWithPassword( const QString &passwd )
 {
+        if ( isAway() )
+        {
+                slotGoOnline();
+                return;
+        }
+
+        if ( isConnected() || 
+             myself()->onlineStatus() == m_protocol->Connecting )
+        {
+                kdDebug(14180) << "Yahoo plugin: Ignoring connect request (already \
connected)." <<endl; +                return;
+        
+        }
+
         if ( passwd.isNull() )
         { //cancel the connection attempt
@@ -306,5 +320,4 @@ void YahooAccount::connectWithPassword( 
         }
 
-        
         QString server = "scs.msg.yahoo.com";
         int port = 5050;
@@ -311,9 +324,7 @@ void YahooAccount::connectWithPassword( 
 
         YahooSessionManager::manager()->setPager( server, port );
-
         m_session = YahooSessionManager::manager()->createSession( accountId(), \
                passwd );
-        if(!isConnected() && myself()->onlineStatus() != m_protocol->Connecting)
-        {
-                kdDebug(14180) << "Attempting to connect to Yahoo on <" << server << \
":" << port << ">. user <" << accountId() << ">" << endl; +        kdDebug(14180) << \
"Attempting to connect to Yahoo on <" << server << ":"  +                << port << \
">. user <" << accountId() << ">" << endl;  
                 static_cast<YahooContact*>( myself() )->setOnlineStatus( \
m_protocol->Connecting ); @@ -331,11 +340,5 @@ void \
YahooAccount::connectWithPassword(   // TODO: message box saying can't connect?
                 }
-        }
-        else if ( isAway() )
-        {       // They're really away, and they want to un-away.
-                slotGoOnline();
-        }
-        else    // ignore
-                kdDebug(14180) << "Yahoo plugin: Ignoring connect request (already \
connected)." <<endl; +        
 }
 
@@ -752,3 +755,3 @@ void YahooAccount::setOnlineStatus( cons
 
 // vim: set noet ts=4 sts=4 sw=4:
-
+//kate: indent-mode csands; tab-width 4;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic