76
76
kdDebug(YAHOO_RAW_DEBUG) << k_funcinfo << endl;
78
QString to = t->firstParam( 5 );
79
QString timestamp = t->firstParam( 15 );
80
QString utf8 = t->firstParam( 97 );
81
QString from = t->firstParam( 1 ).isEmpty() ? t->firstParam( 4 ) : t->firstParam( 1 );
82
QString msg = t->firstParam( 14 );
83
QString sysmsg = t->firstParam( 16 );
85
if( !sysmsg.isEmpty() )
87
client()->notifyError( "Server message received: ", sysmsg, Client::Error );
93
kdDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "Got a empty message. Dropped." << endl;
97
if( utf8.startsWith( "1" ) )
98
msg = QString::fromUtf8( msg.latin1() );
100
if( t->service() == Yahoo::ServiceSysMessage )
101
emit systemMessage( sysmsg );
104
if( msg.startsWith( "<ding>" ) )
105
emit gotBuzz( from, timestamp.toLong() );
78
int cnt = t->paramCount( 5 );
79
for( int i = 0; i < cnt; ++i )
81
QString to = t->nthParam( 5, i );
82
QString timestamp = t->nthParamSeparated( 15, i, 5 );
83
QString utf8 = t->nthParamSeparated( 97, i, 5 );
84
QString from = t->nthParamSeparated( 1, i, 5 ).isEmpty() ? t->nthParamSeparated( 4, i, 5 ) : t->nthParamSeparated( 1, i, 5 );
85
QString msg = t->nthParamSeparated( 14, i, 5 );
86
QString sysmsg = t->nthParamSeparated( 16, i, 5 );
88
// The arrangement of the key->value pairs is different when there is only one message in the packet.
89
// Separating by key "5" (sender) doesn't work in that case, because the "1" and "4" keys are sent before the "5" key
91
from = t->firstParam( 1 ).isEmpty() ? t->firstParam( 4 ) : t->firstParam( 1 );
93
if( !sysmsg.isEmpty() )
95
client()->notifyError( "Server message received: ", sysmsg, Client::Error );
101
kdDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "Got a empty message. Dropped." << endl;
105
if( utf8.startsWith( "1" ) )
106
msg = QString::fromUtf8( msg.latin1() );
108
if( t->service() == Yahoo::ServiceSysMessage )
109
emit systemMessage( sysmsg );
107
emit gotIm( from, msg, timestamp.toLong(), 0);
112
if( msg.startsWith( "<ding>" ) )
113
emit gotBuzz( from, timestamp.toLong() );
115
emit gotIm( from, msg, timestamp.toLong(), 0);