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

List:       kde-commits
Subject:    kdenetwork/kopete/protocols/oscar
From:       Matt Rogers <mattr () kde ! org>
Date:       2005-01-27 1:56:03
Message-ID: 20050127015603.6A9011D151 () office ! kde ! org
[Download RAW message or body]

CVS commit by mattr: 

Attempt to better normalize the contact ids when searching for the contact
we got the message from. Should prevent duplicate windows from the same
person


  M +11 -8     oscaraccount.cpp   1.162


--- kdenetwork/kopete/protocols/oscar/oscaraccount.cpp  #1.161:1.162
@@ -126,4 +126,7 @@ void OscarAccount::updateContact( Oscar:
 void OscarAccount::slotGotSSIList()
 {
+        //login was successful
+        password().setWrong( false );
+        
         //disconnect signals so we don't attempt to add things to SSI!
         Kopete::ContactList* kcl = Kopete::ContactList::self();
@@ -263,5 +266,5 @@ void OscarAccount::messageReceived( cons
 {
         //the message isn't for us somehow
-        if ( message.receiver() != accountId() )
+        if ( Oscar::normalize( message.receiver() ) != Oscar::normalize( accountId() \
) )  {
                 kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "got a message but we're \
not the receiver: " @@ -276,6 +279,6 @@ void OscarAccount::messageReceived( cons
          * Append to the chat window
          */
-        
-        if ( !contacts()[ message.sender() ] )
+        QString sender = Oscar::normalize( message.sender() );
+        if ( !contacts()[ sender ] )
         {
                 kdDebug(OSCAR_RAW_DEBUG) << "Adding '" << message.sender() << "' as \
temporary contact" << endl; @@ -283,7 +286,7 @@ void OscarAccount::messageReceived( \
cons  }
         
-        OscarContact* sender = static_cast<OscarContact *> ( \
contacts()[message.sender()] ); //should exist now +        OscarContact* ocSender = \
static_cast<OscarContact *> ( contacts()[sender] ); //should exist now  
-        if ( !sender )
+        if ( !ocSender )
         {
                 kdWarning(OSCAR_RAW_DEBUG) << "Temporary contact creation failed for \
'"  @@ -292,6 +295,6 @@ void OscarAccount::messageReceived( cons
         }
         
-        Kopete::ChatSession* chatSession = sender->manager( \
                Kopete::Contact::CanCreate );
-        chatSession->receivedTypingMsg( sender, false ); //person is done typing
+        Kopete::ChatSession* chatSession = ocSender->manager( \
Kopete::Contact::CanCreate ); +        chatSession->receivedTypingMsg( ocSender, \
false ); //person is done typing  
         QString sanitizedMsg = sanitizedMessage( message );
@@ -299,5 +302,5 @@ void OscarAccount::messageReceived( cons
         Kopete::ContactPtrList me;
         me.append( myself() );
-        Kopete::Message chatMessage( message.timestamp(), sender, me, sanitizedMsg,
+        Kopete::Message chatMessage( message.timestamp(), ocSender, me, \
                sanitizedMsg,
                                      Kopete::Message::Inbound, \
Kopete::Message::RichText );  


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

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