Bug 124940

Summary: [liboscar] use new aliases from the server
Product: [Applications] kopete Reporter: Michael Stather <kontakt>
Component: ICQ and AIM PluginsAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Michael Stather 2006-04-05 00:19:24 UTC
Version:           0.11.93 (0.12 Beta 2) (using KDE 3.5.0 Level "a" , SUSE 10.0 UNSUPPORTED)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.8-default

If I rename one of my contacts with another client (for example the official client) kopete doesn´t update the name to the new value.
Comment 1 Matt Rogers 2006-05-06 17:22:40 UTC
Does the metacontact have only the icq contact in it, or are there other contacts in the metacontact?

Also, if you hover the mouse over the icq contact, does the nickname of that individual contact change?

Can you provide debug output so I can see what you're talking about? I would need output from before you rename the contact and also output from after you rename the contact. Having debug output will also help me fix the bug faster.
Comment 2 Michael Stather 2006-06-14 16:39:37 UTC
Since the bug is reproducible, could you try to test it out on your machine, so that you have the debug infos straight away. If you can´t reproduce it I can of course give you the infos.
Comment 3 Roman Jarosz 2006-07-28 15:23:16 UTC
SVN commit 567276 by rjarosz:

Fix Bug 124940: [liboscar] use new aliases from the server
First use alias if a user doesn't have alias than use nickname from user info.

BUG: 124940



 M  +3 -3      icq/icqcontact.cpp  
 M  +4 -0      oscarcontact.cpp  


--- branches/kopete/0.12/kopete/protocols/oscar/icq/icqcontact.cpp #567275:567276
@@ -232,7 +232,7 @@
 	if ( ( ( hasProperty( Kopete::Global::Properties::self()->nickName().key() )
 	         && nickName() == contactId() )
 	     || !hasProperty( Kopete::Global::Properties::self()->nickName().key() ) ) &&
-	     !m_requestingNickname )
+	     !m_requestingNickname && m_ssiItem.alias().isEmpty() )
 	{
 		m_requestingNickname = true;
 		int time = ( KApplication::random() % 20 ) * 1000;
@@ -328,7 +328,7 @@
 	kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "received long info from engine" << endl;
 
 	ICQGeneralUserInfo genInfo = mAccount->engine()->getGeneralInfo( contact );
-	if ( !genInfo.nickname.isEmpty() )
+	if ( m_ssiItem.alias().isEmpty() && !genInfo.nickname.isEmpty() )
 		setNickName( codec->toUnicode( genInfo.nickname ) );
 	emit haveBasicInfo( genInfo );
 
@@ -363,7 +363,7 @@
 	else
 		removeProperty(mProtocol->lastName);
 	*/
-	if ( !shortInfo.nickname.isEmpty() )
+	if ( m_ssiItem.alias().isEmpty() && !shortInfo.nickname.isEmpty() )
 	{
 		kdDebug(14153) << k_funcinfo <<
 			"setting new displayname for former UIN-only Contact" << endl;
--- branches/kopete/0.12/kopete/protocols/oscar/oscarcontact.cpp #567275:567276
@@ -80,6 +80,10 @@
 void OscarContact::setSSIItem( const Oscar::SSI& ssiItem )
 {
 	m_ssiItem = ssiItem;
+
+	if ( !m_ssiItem.alias().isEmpty() )
+		setProperty( Kopete::Global::Properties::self()->nickName(), m_ssiItem.alias() );
+
 	emit updatedSSI();
 }
 
Comment 4 Roman Jarosz 2006-07-28 15:48:18 UTC
SVN commit 567294 by rjarosz:

Backport fix for bug 124940: [liboscar] use new aliases from the server.
First use alias if a user doesn't have alias than use nickname from user info.

CCBUG: 124940



 M  +3 -3      icq/icqcontact.cpp  
 M  +4 -0      oscarcontact.cpp  


--- branches/KDE/3.5/kdenetwork/kopete/protocols/oscar/icq/icqcontact.cpp #567293:567294
@@ -199,7 +199,7 @@
 	if ( ( ( hasProperty( Kopete::Global::Properties::self()->nickName().key() )
 	         && nickName() == contactId() )
 	     || !hasProperty( Kopete::Global::Properties::self()->nickName().key() ) ) &&
-	     !m_requestingNickname )
+	     !m_requestingNickname && m_ssiItem.alias().isEmpty() )
 	{
 		m_requestingNickname = true;
 		int time = ( KApplication::random() % 20 ) * 1000;
@@ -293,7 +293,7 @@
 	kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "received long info from engine" << endl;
 
 	ICQGeneralUserInfo genInfo = mAccount->engine()->getGeneralInfo( contact );
-	if ( !genInfo.nickname.isEmpty() )
+	if ( m_ssiItem.alias().isEmpty() && !genInfo.nickname.isEmpty() )
 		setNickName( genInfo.nickname );
 	emit haveBasicInfo( genInfo );
 
@@ -326,7 +326,7 @@
 	else
 		removeProperty(mProtocol->lastName);
 	*/
-	if ( !shortInfo.nickname.isEmpty() )
+	if ( m_ssiItem.alias().isEmpty() && !shortInfo.nickname.isEmpty() )
 	{
 		kdDebug(14153) << k_funcinfo <<
 			"setting new displayname for former UIN-only Contact" << endl;
--- branches/KDE/3.5/kdenetwork/kopete/protocols/oscar/oscarcontact.cpp #567293:567294
@@ -79,6 +79,10 @@
 void OscarContact::setSSIItem( const Oscar::SSI& ssiItem )
 {
 	m_ssiItem = ssiItem;
+
+	if ( !m_ssiItem.alias().isEmpty() )
+		setProperty( Kopete::Global::Properties::self()->nickName(), m_ssiItem.alias() );
+
 	emit updatedSSI();
 }