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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo
From:       Michael Anthony Cole <colemichae () gmail ! com>
Date:       2010-01-20 7:54:11
Message-ID: 1263974051.746778.4092.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1077426 by michaelacole:

BUG 100504 Yahoo Animated Audibles added the service, because someone can send this \
as a message and it was being dropped, not even the text supplied with the audible \
was being displayed. added the service and the message handler 

 M  +53 -2     messagereceivertask.cpp  
 M  +1 -0      messagereceivertask.h  
 M  +1 -0      yahootypes.h  
 M  +5 -0      ymsgprotocol.cpp  


--- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/messagereceivertask.cpp \
#1077425:1077426 @@ -43,9 +43,20 @@
 		return false;
 	
 	if( t->service() == Yahoo::ServiceNotify )
+	{
 		parseNotify( t );
+	}
 	else
-		parseMessage( t );
+	{
+		if( t->service() == Yahoo::ServiceAnimatedAudibleIcon )
+		{
+			parseAnimatedAudibleIcon( t );
+		}
+		else
+		{
+			parseMessage( t );
+		}
+	}
 
 	return true;
 }
@@ -60,7 +71,8 @@
 	if ( t->service() == Yahoo::ServiceMessage ||
 		t->service() == Yahoo::ServiceGameMsg ||
 		t->service() == Yahoo::ServiceSysMessage ||
-		t->service() == Yahoo::ServiceNotify )	
+		t->service() == Yahoo::ServiceNotify ||
+		t->service() == Yahoo::ServiceAnimatedAudibleIcon )	
 		return true;
 	else
 		return false;
@@ -112,6 +124,45 @@
 	}
 }
 
+void MessageReceiverTask::parseAnimatedAudibleIcon( YMSGTransfer *t )
+{
+	// added by michaelacole
+	kDebug(YAHOO_RAW_DEBUG) ;
+
+	int cnt = t->paramCount( 5 );
+	for( int i = 0; i < cnt; ++i )
+	{
+		QString to = t->nthParam( 5, i );
+		QString from = t->nthParamSeparated( 1, i, 4 ).isEmpty() ? t->nthParam( 4, i ) : \
t->nthParamSeparated( 1, i, 4 ); +		QString msg = t->nthParamSeparated( 231, i, 4 );
+		QString msg2 = t->nthParamSeparated( 230, i, 4 );
+		QString utf8 = t->nthParamSeparated( 97, i, 4 );
+		QString timestamp = t->nthParamSeparated( 15, i, 4 );
+
+		// The arrangement of the key->value pairs is different when there is only one \
message in the packet. +		// Separating by key "5" (sender) doesn't work in that \
case, because the "1" and "4" keys are sent before the "5" key +		if( cnt == 1 )
+			from = t->firstParam( 1 ).isEmpty() ? t->firstParam( 4 ) : t->firstParam( 1 );
+
+		if( msg.isEmpty() )
+		{
+			kDebug(YAHOO_RAW_DEBUG) << "Got a empty message. Dropped.";
+			continue;
+		}
+
+		if( utf8.startsWith( '1' ) )
+		{
+			msg = QString::fromUtf8( msg.toLatin1() );
+		}
+		
+		msg = "ANIMATED AUDIBLE SENT TO YOU WITH TEXT " + msg;
+		emit gotIm( from, msg, timestamp.toLong(), 0);
+		msg2 = "http://us.dl1.yimg.com//download.yahoo.com/dl/aud/aa/" + msg2 + ".swf";
+		emit gotIm( from, msg2,timestamp.toLong(), 0);
+
+	}
+}
+
 void MessageReceiverTask::parseNotify( YMSGTransfer *t )
 {
 	kDebug(YAHOO_RAW_DEBUG) ;
--- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/messagereceivertask.h \
#1077425:1077426 @@ -37,6 +37,7 @@
 protected:
 	virtual bool forMe( const Transfer *transfer ) const;
 	void parseMessage( YMSGTransfer *transfer );
+	void parseAnimatedAudibleIcon( YMSGTransfer *transfer );
 	void parseNotify( YMSGTransfer *transfer );
 signals:
 	void gotIm(const QString&, const QString&, long, int);
--- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/yahootypes.h \
#1077425:1077426 @@ -95,6 +95,7 @@
 		ServiceVisibility = 0xc5,	/* YMSG13, key 13: 2 = invisible, 1 = visible */
 		ServiceStatus = 0xc6,		/* YMSG13 */
 		ServicePictureStatus = 0xc7,	/* YMSG13, key 213: 0 = none, 1 = avatar, 2 = picture \
*/ +		ServiceAnimatedAudibleIcon = 0xd0,	/* YMSG17 * items 230 is a baseaddress, 231 \
is the text included,232 unknownitem  added by michaelacole*/  ServiceContactDetails \
= 0xd3,	/* YMSG13 */  ServiceChatSession = 0xd4,	
 		ServiceAuthorization = 0xd6,	/* YMSG13 */
--- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/ymsgprotocol.cpp \
#1077425:1077426 @@ -298,6 +298,11 @@
 			kDebug(YAHOO_RAW_DEBUG) << " Parsed packet service -  This means ServiceBuddyList \
" << servicenum;  service = Yahoo::ServiceBuddyList;
 		break;
+		case (Yahoo::ServiceAnimatedAudibleIcon) :
+			//added by michaelacole
+			kDebug(YAHOO_RAW_DEBUG) << " Parsed packet service -  This means \
ServiceAnimatedAudibleIcon " << servicenum; +			service = \
Yahoo::ServiceAnimatedAudibleIcon; +		break;
 		/*
 		ServiceIdle, // 5 (placemarker)
 		ServiceMailStat,


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

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