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

List:       kde-commits
Subject:    kdenonbeta/kopete/protocols/msn
From:       Olivier Goffart <ogoffart () tiscalinet ! be>
Date:       2003-07-13 9:56:33
[Download RAW message or body]

CVS commit by ogoffart: 


Andy, this is the _correct_ way (according to the protocol) to remove theses
GAIM versions notifications.

This patch will remove gaim notifications, and also MSN6 stranges emoticons
messages, and all clients custom messages

personaly, i prefer to see it (that's why i didn't change it before) but
this is not correct to let this "bug" in a release. I also promised to the
Gaim MSN maintener that this will be fixed

PS: i'm not back from holidays, i will be available to realy code only at
24 july


  M +11 -3     msnswitchboardsocket.cpp   1.86


--- kdenonbeta/kopete/protocols/msn/msnswitchboardsocket.cpp  #1.85:1.86
@@ -178,10 +178,14 @@ void MSNSwitchBoardSocket::parseCommand(
 void MSNSwitchBoardSocket::slotReadMessage( const QString &msg )
 {
+        QRegExp rx("Content-Type: ([A-Za-z0-9$!*/\\-]*)");
+        rx.search(msg);
+        QString type=rx.cap(1);
+
         // incoming message for File-transfer
-        if( msg.contains("Content-Type: text/x-msmsgsinvite; charset=UTF-8") )
+        if( type== "text/x-msmsgsinvite"  )
         {
                 emit invitation(m_msgHandle,msg);
         }
-        else if( msg.contains( "MIME-Version: 1.0\r\nContent-Type: \
text/x-msmsgscontrol\r\nTypingUser:" ) ) +        else if( type== \
"text/x-msmsgscontrol" )  {
                 QString message;
@@ -190,5 +194,5 @@ void MSNSwitchBoardSocket::slotReadMessa
                 emit receivedTypingMsg( message, true );
         }
-        else// if(msg.contains("Content-Type: text/plain;"))
+        else if(type=="text/plain"   || type.isEmpty() )
         {
                 // Some MSN Clients (like CCMSN) don't like to stick to the rules.
@@ -287,4 +291,8 @@ void MSNSwitchBoardSocket::slotReadMessa
 
                 emit msgReceived( kmsg );
+        }
+        else
+        {
+                kdDebug(14140) << "MSNSwitchBoardSocket::slotReadMessage: Unknown \
type '" << type << "' message: \n"<< msg <<endl;  }
 }


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

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