Version: 0.12 (using KDE KDE 3.5.4) Installed from: Ubuntu Packages OS: Linux Because kopete yahoo filetransfer does not support multible file transfers a contact sent me every single file by a new file transfer request. So serveral windows were open - but only the first file was transfered - and this with this over 100% problem. All in all 0 Byte where really transfered.
Heres the link to the image: http://www.ernestoruge.de/misc/img/misc/kopete_yahoo_filetransfer_bug.png
SVN commit 574652 by duffeck: Handle simultaneous filetransfers properly. NOTE: filetransfers containing several files at once are still not supported. BUG: 132101 M +7 -1 libkyahoo/receivefiletask.cpp M +35 -14 yahooaccount.cpp M +1 -0 yahooaccount.h --- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/libkyahoo/receivefiletask.cpp #574651:574652 @@ -107,7 +107,13 @@ if( t->service() == Yahoo::ServiceFileTransfer7Info ) - return true; + { + // Only take this transfer if we are the corresponding task (in case of simultaneous file transfers) + if( t->firstParam( 265 ) == m_remoteUrl.url().local8Bit() ) + return true; + else + return false; + } else return false; } --- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp #574651:574652 @@ -1361,35 +1361,56 @@ kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << "Filename :" << fname << " size:" << fesize << endl; Kopete::TransferManager::transferManager()->askIncomingTransfer( contact( who ) , fname, fesize, msg, url ); - QObject::connect( Kopete::TransferManager::transferManager(), SIGNAL( accepted( Kopete::Transfer *, const QString& ) ), - this, SLOT( slotReceiveFileAccepted( Kopete::Transfer *, const QString& ) ) ); - QObject::connect( Kopete::TransferManager::transferManager(), SIGNAL( refused(const Kopete::FileTransferInfo& ) ), - this, SLOT( slotReceiveFileRefused( const Kopete::FileTransferInfo& ) ) ); + + if( m_pendingFileTransfers.empty() ) + { + QObject::connect( Kopete::TransferManager::transferManager(), SIGNAL( accepted( Kopete::Transfer *, const QString& ) ), + this, SLOT( slotReceiveFileAccepted( Kopete::Transfer *, const QString& ) ) ); + QObject::connect( Kopete::TransferManager::transferManager(), SIGNAL( refused(const Kopete::FileTransferInfo& ) ), + this, SLOT( slotReceiveFileRefused( const Kopete::FileTransferInfo& ) ) ); + } + m_pendingFileTransfers.append( url ); } void YahooAccount::slotReceiveFileAccepted(Kopete::Transfer *transfer, const QString& fileName) { - m_session->receiveFile( transfer->info().transferId(), transfer->info().contact()->contactId(), transfer->info().internalId(), fileName ); - QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( accepted( Kopete::Transfer *, const QString& ) ), - this, SLOT( slotReceiveFileAccepted( Kopete::Transfer *, const QString& ) ) ); - QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( refused(const Kopete::FileTransferInfo& ) ), - this, SLOT( slotReceiveFileRefused( const Kopete::FileTransferInfo& ) ) ); + if( !m_pendingFileTransfers.contains( transfer->info().internalId() ) ) + return; + m_pendingFileTransfers.remove( transfer->info().internalId() ); + m_session->receiveFile( transfer->info().transferId(), transfer->info().contact()->contactId(), transfer->info().internalId(), fileName ); m_fileTransfers.insert( transfer->info().transferId(), transfer ); QObject::connect( transfer, SIGNAL(result( KIO::Job * )), this, SLOT(slotFileTransferResult( KIO::Job * )) ); + + if( m_pendingFileTransfers.empty() ) + { + QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( accepted( Kopete::Transfer *, const QString& ) ), + this, SLOT( slotReceiveFileAccepted( Kopete::Transfer *, const QString& ) ) ); + QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( refused(const Kopete::FileTransferInfo& ) ), + this, SLOT( slotReceiveFileRefused( const Kopete::FileTransferInfo& ) ) ); + } } void YahooAccount::slotReceiveFileRefused( const Kopete::FileTransferInfo& info ) -{ +{ + if( !m_pendingFileTransfers.contains( info.internalId() ) ) + return; + + m_pendingFileTransfers.remove( info.internalId() ); m_session->rejectFile( info.contact()->contactId(), info.internalId() ); - QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( accepted( Kopete::Transfer *, const QString& ) ), - this, SLOT( slotReceiveFileAccepted( Kopete::Transfer *, const QString& ) ) ); - QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( refused(const Kopete::FileTransferInfo& ) ), - this, SLOT( slotReceiveFileRefused( const Kopete::FileTransferInfo& ) ) ); + + if( m_pendingFileTransfers.empty() ) + { + QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( accepted( Kopete::Transfer *, const QString& ) ), + this, SLOT( slotReceiveFileAccepted( Kopete::Transfer *, const QString& ) ) ); + QObject::disconnect( Kopete::TransferManager::transferManager(), SIGNAL( refused(const Kopete::FileTransferInfo& ) ), + this, SLOT( slotReceiveFileRefused( const Kopete::FileTransferInfo& ) ) ); + } } void YahooAccount::slotFileTransferBytesProcessed( unsigned int transferId, unsigned int bytes ) { + kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << "Transfer: " << transferId << " Bytes:" << bytes << endl; Kopete::Transfer *t = m_fileTransfers[transferId]; if( !t ) return; --- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/yahooaccount.h #574651:574652 @@ -266,6 +266,7 @@ QMap<QString, YahooConferenceChatSession *> m_conferences; QStringList m_pendingConfInvites; QStringList m_pendingWebcamInvites; + QStringList m_pendingFileTransfers; QMap<unsigned int, Kopete::Transfer *> m_fileTransfers;