void SendNotifyTask::onGo() { YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceNotify); t->setId( client()->sessionID() ); t->setStatus( Yahoo::StatusNotify ); switch( m_type ) { case NotifyTyping: t->setParam( 4, client()->userId().local8Bit() ); t->setParam( 5, m_target.local8Bit() ); t->setParam( 13, m_state ); t->setParam( 14, " " ); t->setParam( 49, "TYPING" ); break; case NotifyWebcamInvite: kdDebug(YAHOO_RAW_DEBUG) << "send invitation set Param" << endl; t->setParam( 1, client()->userId().local8Bit() ); t->setParam( 5, m_target.local8Bit() ); t->setParam( 13, 0 ); t->setParam( 14, " " ); t->setParam( 49, "WEBCAMINVITE" ); break; case NotifyGame: default: setError(); delete t; return; break; } send( t ); setSuccess(); }
void ConferenceTask::addInvite( const QString &room, const QStringList &who, const QStringList &members, const QString &msg ) { kdDebug(YAHOO_RAW_DEBUG) ; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfAddInvite); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().local8Bit() ); QString whoList = who.first(); for( int i = 1; i < who.size(); i++ ) whoList += QString(",%1").arg( who[i] ); t->setParam( 51, whoList.local8Bit() ); t->setParam( 57, room.local8Bit() ); t->setParam( 58, msg.local8Bit() ); t->setParam( 97, 1 ); for( QStringList::const_iterator it = members.begin(); it != members.end(); ++it ) { t->setParam( 52, (*it).local8Bit() ); t->setParam( 53, (*it).local8Bit() ); // Note: this field should only be set if the buddy has already joined the conference, but no harm is done this way } t->setParam( 13, "0" ); send( t ); }
void SendMessageTask::onGo() { kDebug(YAHOO_RAW_DEBUG) ; if( m_text.isEmpty() ) { kDebug(YAHOO_RAW_DEBUG) << "Text to send is empty."; client()->notifyError( i18n( "An error occurred while sending the message" ), i18n( "The message is empty." ), Client::Debug ); return; } int pos=0; // split messages that are longer than 800 chars. they get dropped otherwise while( pos < m_text.length() ) { YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceMessage, Yahoo::StatusOffline); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().toLocal8Bit() ); t->setParam( 5, m_target.toLocal8Bit() ); t->setParam( 14, m_text.mid( pos, 700).toUtf8() ); t->setParam( 63, ";0" ); t->setParam( 64, "0" ); t->setParam( 97, 1 ); // UTF-8 t->setParam( 206, client()->pictureFlag() ); send( t ); pos += 700; } setSuccess(); }
void PingTask::onGo() { kDebug(YAHOO_RAW_DEBUG) ; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServicePing); t->setId( client()->sessionID() ); send( t ); setSuccess(); }
void RequestPictureTask::onGo() { YMSGTransfer *t = new YMSGTransfer(Yahoo::ServicePicture); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().toLocal8Bit()); t->setParam( 5, m_target.toLocal8Bit() ); t->setParam( 13, "1" ); send( t ); setSuccess(); }
void WebcamTask::registerWebcam() { kDebug(YAHOO_RAW_DEBUG) ; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceWebcam); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().toLocal8Bit()); keysPending.append(client()->userId()); send( t ); }
void ConferenceTask::leaveConference( const QString &room, const QStringList &members ) { kdDebug(YAHOO_RAW_DEBUG) ; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfLogoff); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().local8Bit() ); for( QStringList::const_iterator it = members.begin(); it != members.end(); ++it ) t->setParam( 3, (*it).local8Bit() ); t->setParam( 57, room.local8Bit() ); send( t ); }
void WebcamTask::requestWebcam( const QString &who ) { kDebug(YAHOO_RAW_DEBUG) ; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceWebcam); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().toLocal8Bit()); if (!who.isEmpty()) t->setParam( 5, who.toLocal8Bit() ); keysPending.append(who); send( t ); }
void ConferenceTask::sendMessage( const QString &room, const QStringList &members, const QString &msg ) { kdDebug(YAHOO_RAW_DEBUG) << k_funcinfo << endl; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfMsg); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().local8Bit() ); for( QStringList::const_iterator it = members.begin(); it != members.end(); it++ ) t->setParam( 53, (*it).local8Bit() ); t->setParam( 57, room.local8Bit() ); t->setParam( 14, msg.utf8() ); t->setParam( 97, 1 ); send( t ); }
void ConferenceTask::declineConference( const QString &room, const QStringList &members, const QString &msg ) { kDebug(YAHOO_RAW_DEBUG) ; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfDecline); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().toLocal8Bit() ); for( QStringList::const_iterator it = members.begin(); it != members.end(); ++it ) t->setParam( 3, (*it).toLocal8Bit() ); t->setParam( 57, room.toLocal8Bit() ); t->setParam( 14, msg.toUtf8() ); t->setParam( 97, 1 ); send( t ); }
void ConferenceTask::inviteConference( const QString &room, const QStringList &members, const QString &msg ) { kdDebug(YAHOO_RAW_DEBUG) ; YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfInvite); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().local8Bit() ); t->setParam( 50, client()->userId().local8Bit() ); t->setParam( 57, room.local8Bit() ); t->setParam( 58, msg.local8Bit() ); t->setParam( 97, 1 ); for( QStringList::const_iterator it = members.begin(); it != members.end(); ++it ) t->setParam( 52, (*it).local8Bit() ); t->setParam( 13, "0" ); send( t ); }
void SendAuthRespTask::onGo() { YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceAuthorization); t->setId( client()->sessionID() ); t->setParam( 1, client()->userId().local8Bit() ); t->setParam( 5, m_target.local8Bit() ); if( m_granted ) { t->setParam( 13, 1 ); } else { t->setParam( 13, 2 ); t->setParam( 97, 1 ); // UTF t->setParam( 14, m_msg.utf8() ); } send( t ); setSuccess( true ); }