summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/msn/msnswitchboardsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/msn/msnswitchboardsocket.cpp')
-rw-r--r--kopete/protocols/msn/msnswitchboardsocket.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/kopete/protocols/msn/msnswitchboardsocket.cpp b/kopete/protocols/msn/msnswitchboardsocket.cpp
index b0052552..f5cc890a 100644
--- a/kopete/protocols/msn/msnswitchboardsocket.cpp
+++ b/kopete/protocols/msn/msnswitchboardsocket.cpp
@@ -93,8 +93,8 @@ void MSNSwitchBoardSocket::connectToSwitchBoard(TQString ID, TQString address, T
m_ID = ID;
m_auth = auth;
- TQString server = address.left( address.tqfind( ":" ) );
- uint port = address.right( address.length() - address.tqfindRev( ":" ) - 1 ).toUInt();
+ TQString server = address.left( address.find( ":" ) );
+ uint port = address.right( address.length() - address.findRev( ":" ) - 1 ).toUInt();
TQObject::connect( this, TQT_SIGNAL( blockRead( const TQByteArray & ) ),
this, TQT_SLOT(slotReadMessage( const TQByteArray & ) ) );
@@ -191,7 +191,7 @@ void MSNSwitchBoardSocket::parseCommand( const TQString &cmd, uint id ,
// new user joins the chat, update user in chat list
TQString handle = data.section( ' ', 0, 0 );
TQString screenname = unescape(data.section( ' ', 1, 1 ));
- if( !m_chatMembers.tqcontains( handle ) )
+ if( !m_chatMembers.contains( handle ) )
m_chatMembers.append( handle );
emit userJoined( handle, screenname, false );
}
@@ -199,7 +199,7 @@ void MSNSwitchBoardSocket::parseCommand( const TQString &cmd, uint id ,
{
// we have joined a multi chat session- this are the users in this chat
TQString handle = data.section( ' ', 2, 2 );
- if( !m_chatMembers.tqcontains( handle ) )
+ if( !m_chatMembers.contains( handle ) )
m_chatMembers.append( handle );
TQString screenname = unescape(data.section( ' ', 3, 3));
@@ -214,7 +214,7 @@ void MSNSwitchBoardSocket::parseCommand( const TQString &cmd, uint id ,
// some has disconnect from chat, update user in chat list
cleanQueue(); //in case some message are waiting their emoticons, never mind, send them
- TQString handle = data.section( ' ', 0, 0 ).tqreplace( "\r\n" , "" );
+ TQString handle = data.section( ' ', 0, 0 ).replace( "\r\n" , "" );
userLeftChat( handle, (data.section( ' ', 1, 1 ) == "1" ) ? i18n("timeout") : TQString() );
}
else if( cmd == "MSG" )
@@ -265,13 +265,13 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
else if( type== "text/x-msmsgscontrol" )
{
TQString message;
- message = msg.right( msg.length() - msg.tqfindRev( " " ) - 1 );
- message = message.tqreplace( "\r\n" ,"" );
+ message = msg.right( msg.length() - msg.findRev( " " ) - 1 );
+ message = message.replace( "\r\n" ,"" );
emit receivedTypingMsg( message.lower(), true );
}
else if(type == "text/x-msnmsgr-datacast")
{
- if(msg.tqcontains("ID:"))
+ if(msg.contains("ID:"))
{
TQRegExp rx("ID: ([0-9]*)");
rx.search(msg);
@@ -293,7 +293,7 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
TQColor fontColor;
TQFont font;
- if ( msg.tqcontains( "X-MMS-IM-Format" ) )
+ if ( msg.contains( "X-MMS-IM-Format" ) )
{
TQString fontName;
TQString fontInfo;
@@ -329,7 +329,7 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
}
}
- fontName = parseFontAttr(fontInfo, "FN").tqreplace( "%20" , " " );
+ fontName = parseFontAttr(fontInfo, "FN").replace( "%20" , " " );
// Some clients like Trillian and Kopete itself send a font
// name of 'MS Serif' since MS changed the server to
@@ -343,10 +343,10 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
font = TQFont( fontName,
parseFontAttr( fontInfo, "PF" ).toInt(), // font size
- ef.tqcontains( 'B' ) ? TQFont::Bold : TQFont::Normal,
- ef.tqcontains( 'I' ) );
- font.setUnderline(ef.tqcontains( 'U' ));
- font.setStrikeOut(ef.tqcontains( 'S' ));
+ ef.contains( 'B' ) ? TQFont::Bold : TQFont::Normal,
+ ef.contains( 'I' ) );
+ font.setUnderline(ef.contains( 'U' ));
+ font.setStrikeOut(ef.contains( 'S' ));
}
}
@@ -359,17 +359,17 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
others.append( m_account->contacts()[ *it2 ] );
}
- TQString message=msg.right( msg.length() - msg.tqfind("\r\n\r\n") - 4 );
+ TQString message=msg.right( msg.length() - msg.find("\r\n\r\n") - 4 );
//Stupid MSN PLUS colors code. message with incorrect charactere are not showed correctly in the chatwindow.
//TODO: parse theses one to show the color too in Kopete
- message.tqreplace("\3","").tqreplace("\4","").tqreplace("\2","").tqreplace("\5","").tqreplace("\6","").tqreplace("\7","");
+ message.replace("\3","").replace("\4","").replace("\2","").replace("\5","").replace("\6","").replace("\7","");
if(!m_account->contacts()[m_msgHandle])
{
//this may happens if the contact has been deleted.
kdDebug(14140) << k_funcinfo <<"WARNING: contact is null, adding it" <<endl;
- if( !m_chatMembers.tqcontains( m_msgHandle ) )
+ if( !m_chatMembers.contains( m_msgHandle ) )
m_chatMembers.append( m_msgHandle );
emit userJoined( m_msgHandle , m_msgHandle , false);
}
@@ -432,7 +432,7 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
TQString txt=rx.cap(1);
kdDebug(14140) << k_funcinfo << "emoticon: " << txt << " msnobj: " << msnobj<< endl;
- if( !m_emoticons.tqcontains(msnobj) || !m_emoticons[msnobj].second )
+ if( !m_emoticons.contains(msnobj) || !m_emoticons[msnobj].second )
{
m_emoticons.insert(msnobj, tqMakePair(txt,(KTempFile*)0L));
MSNContact *c=static_cast<MSNContact*>(m_account->contacts()[m_msgHandle]);
@@ -493,7 +493,7 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
}
- else if(type == "image/gif" || msg.tqcontains("Message-ID:"))
+ else if(type == "image/gif" || msg.contains("Message-ID:"))
{
// Incoming inkformatgif.
TQRegExp regex("Message-ID: \\{([0-9A-F\\-]*)\\}");
@@ -536,7 +536,7 @@ void MSNSwitchBoardSocket::slotReadMessage( const TQByteArray &bytes )
if(!messageId.isNull())
{
- if(m_inkMessageBuffer.tqcontains(messageId))
+ if(m_inkMessageBuffer.contains(messageId))
{
if(chunks.isNull())
{
@@ -660,7 +660,7 @@ int MSNSwitchBoardSocket::sendMsg( const Kopete::Message &msg )
}
#if 0 //this is to test webcam
- if(msg.plainBody().tqcontains("/webcam"))
+ if(msg.plainBody().contains("/webcam"))
{
PeerDispatcher()->startWebcam( m_myHandle , m_msgHandle);
return -3;
@@ -678,7 +678,7 @@ int MSNSwitchBoardSocket::sendMsg( const Kopete::Message &msg )
{
for ( TQStringList::const_iterator itr2 = itr.data().constBegin(); itr2 != itr.data().constEnd(); ++itr2 )
{
- if ( msg.plainBody().tqcontains( *itr2 ) )
+ if ( msg.plainBody().contains( *itr2 ) )
sendCustomEmoticon( *itr2, itr.key() );
}
}
@@ -748,7 +748,7 @@ int MSNSwitchBoardSocket::sendMsg( const Kopete::Message &msg )
head += "; RL=1";
head += "\r\n";
- TQString message= msg.plainBody().tqreplace( "\n" , "\r\n" );
+ TQString message= msg.plainBody().replace( "\n" , "\r\n" );
//-- Check if the message isn't too big, TODO: do that at the libkopete level.
int len_H=head.utf8().length(); // != head.length() because i need the size in butes and
@@ -888,7 +888,7 @@ void MSNSwitchBoardSocket::userLeftChat(const TQString& handle , const TQString
{
emit userLeft( handle, reason );
- if( m_chatMembers.tqcontains( handle ) )
+ if( m_chatMembers.contains( handle ) )
m_chatMembers.remove( handle );
if(m_chatMembers.isEmpty())
@@ -907,7 +907,7 @@ void MSNSwitchBoardSocket::slotEmoticonReceived( KTempFile *file, const TQStrin
{
kdDebug(14141) << k_funcinfo << msnObj << endl;
- if(m_emoticons.tqcontains(msnObj))
+ if(m_emoticons.contains(msnObj))
{ //it's an emoticon
m_emoticons[msnObj].second=file;
@@ -941,7 +941,7 @@ void MSNSwitchBoardSocket::slotEmoticonReceived( KTempFile *file, const TQStrin
{
//this may happens if the contact has been deleted.
kdDebug(14140) << k_funcinfo <<"WARNING: contact is null, adding it" <<endl;
- if( !m_chatMembers.tqcontains( m_msgHandle ) )
+ if( !m_chatMembers.contains( m_msgHandle ) )
m_chatMembers.append( m_msgHandle );
emit userJoined( m_msgHandle , m_msgHandle , false);
}
@@ -976,7 +976,7 @@ void MSNSwitchBoardSocket::slotIncomingFileTransfer(const TQString& from, const
{
//this may happens if the contact has been deleted.
kdDebug(14140) << k_funcinfo <<"WARNING: contact is null, adding it" <<endl;
- if( !m_chatMembers.tqcontains( m_msgHandle ) )
+ if( !m_chatMembers.contains( m_msgHandle ) )
m_chatMembers.append( m_msgHandle );
emit userJoined( m_msgHandle , m_msgHandle , false);
}
@@ -1013,7 +1013,7 @@ Kopete::Message &MSNSwitchBoardSocket::parseCustomEmoticons(Kopete::Message &kms
{
TQString es=TQStyleSheet::escape(it.data().first);
KTempFile *f=it.data().second;
- if(message.tqcontains(es) && f)
+ if(message.contains(es) && f)
{
TQString imgPath = f->name();
TQImage iconImage(imgPath);
@@ -1021,11 +1021,11 @@ Kopete::Message &MSNSwitchBoardSocket::parseCustomEmoticons(Kopete::Message &kms
* emoticons like that. So, in that case, we show like the MSN client */
#if 0
TQString em = TQRegExp::escape( es );
- message.tqreplace( TQRegExp(TQString::tqfromLatin1( "(^|[\\W\\s]|%1)(%2)(?!\\w)" ).tqarg(em).tqarg(em)),
+ message.replace( TQRegExp(TQString::tqfromLatin1( "(^|[\\W\\s]|%1)(%2)(?!\\w)" ).tqarg(em).tqarg(em)),
TQString::tqfromLatin1("\\1<img align=\"center\" width=\"") +
#endif
//match any occurence which is not in a html tag.
- message.tqreplace( TQRegExp(TQString::tqfromLatin1("%1(?![^><]*>)").tqarg(TQRegExp::escape(es))),
+ message.replace( TQRegExp(TQString::tqfromLatin1("%1(?![^><]*>)").tqarg(TQRegExp::escape(es))),
TQString::tqfromLatin1("<img align=\"center\" width=\"") +
TQString::number(iconImage.width()) +
TQString::tqfromLatin1("\" height=\"") +
@@ -1060,12 +1060,12 @@ TQString MSNSwitchBoardSocket::parseFontAttr(TQString str, TQString attr)
TQString tmp;
int pos1=0, pos2=0;
- pos1 = str.tqfind(attr + "=");
+ pos1 = str.find(attr + "=");
if (pos1 == -1)
return "";
- pos2 = str.tqfind(";", pos1+3);
+ pos2 = str.find(";", pos1+3);
if (pos2 == -1)
tmp = str.mid(pos1+3, str.length() - pos1 - 3);