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

List:       kde-commits
Subject:    kdenetwork/kopete/libkopete
From:       Olivier Goffart <ogoffart () kde ! org>
Date:       2005-04-30 8:58:19
Message-ID: 20050430085819.8654D665 () office ! kde ! org
[Download RAW message or body]

CVS commit by ogoffart: 

Don't let the myself contact be deserialized, or it will conflict with the myself \
metacontact


  M +12 -1     kopeteprotocol.cpp   1.93


--- kdenetwork/kopete/libkopete/kopeteprotocol.cpp  #1.92:1.93
@@ -264,4 +264,14 @@ void Protocol::deserialize( MetaContact 
                 }
 
+                const QString& accountId=sd[ QString::fromLatin1( "accountId" ) ];
+                // myself was allowed in the contactlist in old version of kopete.
+                // But if one keep it on the contactlist now, it may conflict witht \
he myself metacontact. +                // So ignore it
+                if(accountId == sd[ QString::fromLatin1( "contactId" ) ] )
+                {
+                        kdDebug( 14010 ) << k_funcinfo << "Myself contact was on the \
contactlist.xml for account " << accountId << ".  Ignore it" << endl; +               \
continue; +                }
+
                 // FIXME: This code almost certainly breaks when having more than
                 //        one contact in a meta contact. There are solutions, but
@@ -291,5 +301,5 @@ void Protocol::deserialize( MetaContact 
                 // might not be what you want for corrupted accounts, but it's \
                correct for people
                 // who migrate from 0.6, as there's only one account in that case
-                if( sd[ QString::fromLatin1( "accountId" ) ].isNull() )
+                if( accountId.isNull() )
                 {
                         QDict<Account> accounts = AccountManager::self()->accounts( \
this ); @@ -308,4 +318,5 @@ void Protocol::deserialize( MetaContact 
                 }
 
+                
                 Contact *c = deserializeContact( metaContact, sd, ad );
                 if (c) // should never be null but I do not like crashes


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

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