diff options
Diffstat (limited to 'kopete/protocols/msn/msnsocket.cpp')
-rw-r--r-- | kopete/protocols/msn/msnsocket.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/kopete/protocols/msn/msnsocket.cpp b/kopete/protocols/msn/msnsocket.cpp index 3e5d84fd..6dc8fa94 100644 --- a/kopete/protocols/msn/msnsocket.cpp +++ b/kopete/protocols/msn/msnsocket.cpp @@ -249,12 +249,12 @@ void MSNSocket::slotDataReceived() // Check if all data has arrived. rawData = TQString(TQCString(buffer, avail + 1)); - bool headers = (rawData.tqfind(TQRegExp("HTTP/\\d\\.\\d (\\d+) ([^\r\n]+)")) != -1); + bool headers = (rawData.find(TQRegExp("HTTP/\\d\\.\\d (\\d+) ([^\r\n]+)")) != -1); if(headers) { // The http header packet arrived. - int endOfHeaders = rawData.tqfind("\r\n\r\n"); + int endOfHeaders = rawData.find("\r\n\r\n"); if((endOfHeaders + 4) == avail) { // Only the response headers data is included. @@ -314,17 +314,17 @@ void MSNSocket::slotDataReceived() // Retrieve the X-MSN-Messenger header. TQString header = response.getHeaders()->getValue("X-MSN-Messenger"); - TQStringList parts = TQStringList::split(";", header.tqreplace(" ", "")); + TQStringList parts = TQStringList::split(";", header.replace(" ", "")); if(!header.isNull() && (parts.count() >= 2)) { - if(parts[0].tqfind("SessionID", 0) != -1) + if(parts[0].find("SessionID", 0) != -1) { // Assign the session id. m_sessionId = parts[0].section("=", 1, 1); }else error = true; - if(parts[1].tqfind("GW-IP", 0) != -1) + if(parts[1].find("GW-IP", 0) != -1) { // Assign the gateway IP address. m_gwip = parts[1].section("=", 1, 1); @@ -333,7 +333,7 @@ void MSNSocket::slotDataReceived() if(parts.count() > 2) - if((parts[2].tqfind("Session", 0) != -1) && (parts[2].section("=", 1, 1) == "close")) + if((parts[2].find("Session", 0) != -1) && (parts[2].section("=", 1, 1) == "close")) { // The http session has been closed by the server, disconnect. kdDebug(14140) << k_funcinfo << "Session closed." << endl; @@ -390,7 +390,7 @@ void MSNSocket::slotDataReceived() // all MSN commands start with one or more uppercase characters. // For now just check the first three chars, let's see how accurate it is. // Additionally, if we receive an MSN-P2P packet, strip off anything after the P2P header. - rawData = TQString( TQCString( buffer, ((!m_useHttp)? avail : ret) + 1 ) ).stripWhiteSpace().tqreplace( + rawData = TQString( TQCString( buffer, ((!m_useHttp)? avail : ret) + 1 ) ).stripWhiteSpace().replace( TQRegExp( "(P2P-Dest:.[a-zA-Z@.]*).*" ), "\\1\n\n(Stripped binary data)" ); bool isBinary = false; @@ -446,7 +446,7 @@ void MSNSocket::slotReadLine() if ( index != -1 ) { TQString command = TQString::fromUtf8( m_buffer.take( index + 2 ), index ); - command.tqreplace( "\r\n", "" ); + command.replace( "\r\n", "" ); //kdDebug( 14141 ) << k_funcinfo << command << endl; // Don't block the GUI while parsing data, only do a single line! @@ -502,7 +502,7 @@ bool MSNSocket::pollReadBlock() void MSNSocket::parseLine( const TQString &str ) { TQString cmd = str.section( ' ', 0, 0 ); - TQString data = str.section( ' ', 2 ).tqreplace( "\r\n" , "" ); + TQString data = str.section( ' ', 2 ).replace( "\r\n" , "" ); bool isNum; uint id = str.section( ' ', 1, 1 ).toUInt( &isNum ); @@ -517,7 +517,7 @@ void MSNSocket::parseLine( const TQString &str ) //kdDebug( 14140 ) << k_funcinfo << "Parsing command " << cmd << " (ID " << id << "): '" << data << "'" << endl; - data.tqreplace( "\r\n", "" ); + data.replace( "\r\n", "" ); bool isError; uint errorCode = cmd.toUInt( &isError ); if ( isError ) @@ -725,7 +725,7 @@ void MSNSocket::slotReadyWrite() // Simple check to avoid dumping the binary data from the icons and emoticons to kdDebug: // When sending an MSN-P2P packet, strip off anything after the P2P header. - TQString debugData = TQString( *it ).stripWhiteSpace().tqreplace( + TQString debugData = TQString( *it ).stripWhiteSpace().replace( TQRegExp( "(P2P-Dest:.[a-zA-Z@.]*).*" ), "\\1\n\n(Stripped binary data)" ); kdDebug( 14141 ) << k_funcinfo << "Sending command: " << debugData << endl; @@ -790,10 +790,10 @@ TQString MSNSocket::unescape( const TQString &str ) { TQString str2 = KURL::decode_string( str, 106 ); //remove msn+ colors code - str2 = str2.tqreplace( TQRegExp("[\\x1-\\x8]"), "" ); // old msn+ colors + str2 = str2.replace( TQRegExp("[\\x1-\\x8]"), "" ); // old msn+ colors // added by kaoul <erwin.kwolek at gmail.com> - str2 = str2.tqreplace( TQRegExp("\\xB7[&@\'#0]"),""); // dot ... - str2 = str2.tqreplace( TQRegExp("\\xB7\\$,?\\d{1,2}"),""); // dot dollar (comma)? 0-99 + str2 = str2.replace( TQRegExp("\\xB7[&@\'#0]"),""); // dot ... + str2 = str2.replace( TQRegExp("\\xB7\\$,?\\d{1,2}"),""); // dot dollar (comma)? 0-99 return str2; } @@ -1031,7 +1031,7 @@ MSNSocket::WebResponse::WebResponse(const TQByteArray& bytes) // Parse the HTTP status header TQRegExp re("HTTP/\\d\\.\\d (\\d+) ([^\r\n]+)"); - headerEnd = data.tqfind("\r\n"); + headerEnd = data.find("\r\n"); header = data.left( (headerEnd == -1) ? 20 : headerEnd ); re.search(header); @@ -1039,7 +1039,7 @@ MSNSocket::WebResponse::WebResponse(const TQByteArray& bytes) m_statusDescription = re.cap(2); // Remove the web response status header. - data = data.mid(headerEnd + 2, (data.tqfind("\r\n\r\n") + 2) - (headerEnd + 2)); + data = data.mid(headerEnd + 2, (data.find("\r\n\r\n") + 2) - (headerEnd + 2)); // Create a MimeMessage, removing the HTTP status header m_headers = new MimeMessage(data); |