Bug 127921

Summary: Contact status not correct updated after reconnect to internet
Product: [Applications] kopete Reporter: Heiko Schaefer <heiko>
Component: generalAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Heiko Schaefer 2006-05-24 09:14:42 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    SuSE RPMs
OS:                Linux

If I disconnect from the internet without setting my ICQ account to offline before and then reconnect to internet and ICQ, the status of my contacts is unchanged, even if they went offline.

Only a restart of Kopete updates the status in the contactlist.
Comment 1 Roman Jarosz 2006-05-27 12:19:05 UTC
SVN commit 545306 by rjarosz:

Fix bug 127921: Contact status not correct updated after reconnect to internet

BUG: 127921



 M  +9 -0      aim/aimaccount.cpp  
 M  +14 -0     icq/icqaccount.cpp  


--- branches/kopete/0.12/kopete/protocols/oscar/aim/aimaccount.cpp #545305:545306
@@ -580,6 +580,15 @@
 {
 	kdDebug( OSCAR_AIM_DEBUG ) << k_funcinfo << "Attempting to set status offline" << endl;
 	myself()->setOnlineStatus( static_cast<AIMProtocol*>( protocol() )->statusOffline );
+
+	QDictIterator<Kopete::Contact> it( contacts() );
+	for( ; it.current(); ++it )
+	{
+		OscarContact* oc = dynamic_cast<OscarContact*>( it.current() );
+		if ( oc )
+			oc->setOnlineStatus( static_cast<AIMProtocol*>( protocol() )->statusOffline );
+	}
+
 	OscarAccount::disconnected( reason );
 }
 
--- branches/kopete/0.12/kopete/protocols/oscar/icq/icqaccount.cpp #545305:545306
@@ -195,6 +195,20 @@
 	kdDebug(14153) << k_funcinfo << "Attempting to set status offline" << endl;
 	ICQ::Presence presOffline = ICQ::Presence( ICQ::Presence::Offline, presence().visibility() );
 	myself()->setOnlineStatus( presOffline.toOnlineStatus() );
+
+	QDictIterator<Kopete::Contact> it( contacts() );
+	for( ; it.current(); ++it )
+	{
+		OscarContact* oc = dynamic_cast<OscarContact*>( it.current() );
+		if ( oc )
+		{
+			if ( oc->ssiItem().waitingAuth() )
+				oc->setOnlineStatus( protocol()->statusManager()->waitingForAuth() );
+			else
+				oc->setOnlineStatus( ICQ::Presence( ICQ::Presence::Offline, ICQ::Presence::Visible ).toOnlineStatus() );
+		}
+	}
+
 	OscarAccount::disconnected( reason );
 }