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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/protocols/msn
From:       Will Stephenson <wstephenson () kde ! org>
Date:       2008-09-26 6:08:44
Message-ID: 1222409324.144311.3871.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 864936 by wstephens:

Make safe lookup of contacts using data obtained from the wire.

 M  +18 -10    msnnotifysocket.cpp  


--- trunk/KDE/kdenetwork/kopete/protocols/msn/msnnotifysocket.cpp #864935:864936
@@ -375,19 +375,27 @@
 	else if( cmd == "ILN" ||  cmd == "NLN" )
 	{
 		// status handle publicName strangeNumber MSNOBJECT
-		MSNContact *c = static_cast<MSNContact*>( m_account->contacts()[ data.section( ' \
                ', 1, 1 ) ] );
-		if( c && c->contactId() != m_account->accountId() )
+		QString contactIdString = data.section( ' ', 1, 1 );
+		if ( m_account->contacts().contains(contactIdString) )
 		{
-			QString publicName=unescape( data.section( ' ', 2, 2 ) );
-			if ( (publicName!=c->contactId() ||  \
                c->hasProperty(Kopete::Global::Properties::self()->nickName().key())  \
                ) &&
-						 publicName!=c->property( \
Kopete::Global::Properties::self()->nickName()).value().toString() ) +			MSNContact \
*c = static_cast<MSNContact*>( m_account->contacts()[ contactIdString ] ); +			if( c \
&& c->contactId() != m_account->accountId() ) +			{
+				QString publicName=unescape( data.section( ' ', 2, 2 ) );
+				if ( (publicName!=c->contactId() ||  \
c->hasProperty(Kopete::Global::Properties::self()->nickName().key())  ) && \
+						publicName!=c->property( \
Kopete::Global::Properties::self()->nickName()).value().toString() )  
-				changePublicName(publicName,c->contactId());
-			QString obj=unescape(data.section( ' ', 4, 4 ));
-			c->setObject( obj );
-			c->setOnlineStatus( convertOnlineStatus( data.section( ' ', 0, 0 ) ) );
-			c->setClientFlags(data.section( ' ', 3, 3 ).toUInt());
+					changePublicName(publicName,c->contactId());
+				QString obj=unescape(data.section( ' ', 4, 4 ));
+				c->setObject( obj );
+				c->setOnlineStatus( convertOnlineStatus( data.section( ' ', 0, 0 ) ) );
+				c->setClientFlags(data.section( ' ', 3, 3 ).toUInt());
+			}
 		}
+		else
+		{
+			kDebug(14140) << "Unrecognised contact id found in LST:" << contactIdString;
+		}
 	}
 	else if( cmd == "UBX" )
 	{


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

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