[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdenetwork/kopete/protocols/oscar/liboscar
From: Roman Jarosz <kedgedev () gmail ! com>
Date: 2010-01-28 20:19:39
Message-ID: 1264709979.304598.22652.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1081592 by rjarosz:
Correctly parse ICQ 7 away messages.
Fix buffer underflow in UserDetails.
On status change set setAwayMessage for ICQ too and fix the tasks order.
M +3 -4 client.cpp
M +4 -1 tasks/messagereceivertask.cpp
M +5 -4 userdetails.cpp
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/client.cpp #1081591:1081592
@@ -334,8 +334,6 @@
if ( !d->isIcq && (status & 0xFF) == 0x00 ) //not icq and status is online
sdcit->setStatusMessage( message );
- sdcit->go( Task::AutoDelete ); //autodelete
-
QString msg;
// AIM: you're away exactly when your away message isn't empty.
// can't use QString() as a message either; ProfileTask
@@ -353,13 +351,14 @@
}
ProfileTask* pt = new ProfileTask( c->rootTask() );
- if ( !d->isIcq ) // Don't break EA, DND... for ICQ
- pt->setAwayMessage( msg );
+ pt->setAwayMessage( msg );
if ( d->isIcq && xtrazChanged )
pt->setXtrazStatus( xtraz );
pt->go( Task::AutoDelete );
+ //Has to be sent after ProfileTask otherwise the EA, DND will be wrong
+ sdcit->go( Task::AutoDelete );
d->status.sent = true;
}
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/tasks/messagereceivertask.cpp #1081591:1081592
@@ -476,7 +476,10 @@
kDebug(OSCAR_RAW_DEBUG) << "Message type is: " << messageType;
- QByteArray msgText( b->getLELNTS() );
+ QByteArray msgText( b->getLEBlock() );
+ if (!msgText.isEmpty() && msgText.at(msgText.length() - 1) == '\0')
+ msgText.chop(1);
+
Oscar::Message::Encoding encoding = Oscar::Message::UserDefined;
if ( messageType == Oscar::MessageType::Plugin )
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/userdetails.cpp #1081591:1081592
@@ -401,13 +401,14 @@
case 0x0002:
if ( length > 0 )
{
- QByteArray personalMessageData = b.getBSTR();
+ Buffer pmBuffer( b.getBBlock( length ) );
+ QByteArray personalMessageData = pmBuffer.getBSTR();
QTextCodec *codec = 0;
- if ( b.bytesAvailable() >= 4 && b.getWord() == 0x0001 )
+ if ( pmBuffer.bytesAvailable() >= 4 && pmBuffer.getWord() == 0x0001 )
{
- b.skipBytes( 2 );
- QByteArray encoding = b.getBSTR();
+ pmBuffer.skipBytes( 2 );
+ QByteArray encoding = pmBuffer.getBSTR();
codec = QTextCodec::codecForName( encoding );
kDebug(OSCAR_RAW_DEBUG) << "Encoding:" << encoding;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic