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

List:       kde-commits
Subject:    branches/KDE/3.5/kdenetwork/kopete/protocols/oscar/liboscar
From:       Oleg Girko <ol+kde () infoserver ! ru>
Date:       2007-05-10 1:01:26
Message-ID: 1178758886.770820.30460.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 663090 by girko:

Fixed encoding handling in ICQ authorization messages.
This is already fixed in trunk, so this change can be considered
to be simplified backport of encoding fix.

BUG: 145240


 M  +9 -9      ssiauthtask.cpp  


--- branches/KDE/3.5/kdenetwork/kopete/protocols/oscar/liboscar/ssiauthtask.cpp #663089:663090
@@ -93,7 +93,7 @@
 	
 	Buffer* buf = new Buffer();
 	buf->addBUIN( uin.latin1() );
-	buf->addBSTR( reason.latin1() );
+	buf->addBSTR( reason.utf8() );
 	buf->addWord( 0x0000 ); // Unknown
 	
 	Transfer* t = createTransfer( f, s, buf );
@@ -107,7 +107,7 @@
 	
 	Buffer* buf = new Buffer();
 	buf->addBUIN( uin.latin1() );
-	buf->addBSTR( reason.latin1() );
+	buf->addBSTR( reason.utf8() );
 	buf->addWord( 0x0000 ); // Unknown
 	
 	Transfer* t = createTransfer( f, s, buf );
@@ -122,7 +122,7 @@
 	Buffer* buf = new Buffer();
 	buf->addBUIN( uin.latin1() );
 	buf->addByte( auth ? 0x01 : 0x00 ); // accepted / declined
-	buf->addBSTR( reason.latin1() );
+	buf->addBSTR( reason.utf8() );
 	
 	Transfer* t = createTransfer( f, s, buf );
 	send( t );
@@ -133,13 +133,13 @@
 	Buffer* buf = transfer()->buffer();
 	
 	QString uin = Oscar::normalize( buf->getBUIN() );
-	QString reason = buf->getBSTR();
+	QByteArray reason = buf->getBSTR();
 	
 	buf->getWord(); // 0x0000 - Unknown
 	
 	kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Future authorization granted from " << uin << endl;
 	kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Reason: " << reason << endl;
-	emit futureAuthGranted( uin, reason );
+	emit futureAuthGranted( uin, QString::fromUtf8( reason.data(), reason.size() ) );
 }
 
 void SSIAuthTask::handleAuthRequested()
@@ -147,14 +147,14 @@
 	Buffer* buf = transfer()->buffer();
 	
 	QString uin = Oscar::normalize( buf->getBUIN() );
-	QString reason = buf->getBSTR();
+	QByteArray reason = buf->getBSTR();
 	
 	buf->getWord(); // 0x0000 - Unknown
 	
 	kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Authorization requested from " << uin << endl;
 	kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Reason: " << reason << endl;
 	
-	emit authRequested( uin, reason );
+	emit authRequested( uin, QString::fromUtf8( reason.data(), reason.size() ) );
 }
 
 void SSIAuthTask::handleAuthReplied()
@@ -163,7 +163,7 @@
 	
 	QString uin = Oscar::normalize( buf->getBUIN() );
 	bool accepted = buf->getByte();
-	QString reason = buf->getBSTR();
+	QByteArray reason = buf->getBSTR();
 	
 	if ( accepted )
 		kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Authorization request accepted by " << uin << endl;
@@ -171,7 +171,7 @@
 		kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Authorization request declined by " << uin << endl;
 		
 	kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Reason: " << reason << endl;
-	emit authReplied( uin, reason, accepted );
+	emit authReplied( uin, QString::fromUtf8( reason.data(), reason.size() ), accepted );
 }
 
 void SSIAuthTask::handleAddedMessage()
[prev in list] [next in list] [prev in thread] [next in thread] 

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