------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=131218         
andre duffeck de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From andre duffeck de  2006-08-18 00:44 -------
SVN commit 574054 by duffeck:

some fixes in webcam code. That should fix bug 131218.
BUG: 131218


 M  +20 -9     libkyahoo/webcamtask.cpp  
 M  +18 -2     yahooaccount.cpp  
 M  +2 -0      yahooaccount.h  


--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/libkyahoo/webcamtask.cpp 
#574053:574054
 @ -200,6 +200,7  @
        client()->notifyError( i18n("Webcam connection to the user %1 could not 
be established.\n\nPlease relogin and try again.")
                        .arg(socketMap[socket].sender), QString("%1 - 
%2").arg(error).arg( socket->errorString()), Client::Error );
        socketMap.remove( socket );
+       socket->deleteLater();
 }
 
 void WebcamTask::slotRead()
 @ -233,21 +234,28  @
        kdDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "Magic Byte:" << data[2] << 
endl;
 
        socketMap[socket].status = ConnectedStage2;
-       if( data[2] == (Q_INT8)0x06 )
+
+       QString server;
+       int i = 4;
+       KStreamSocket *newSocket;
+       switch( (const char)data[2] )
        {
+       case (Q_INT8)0x06:
                emit webcamNotAvailable(socketMap[socket].sender);
-       }
-       else if( data[2] == (Q_INT8)0x04 || data[2] == (Q_INT8)0x07 )
-       {
-               QString server;
-               int i = 4;
-               while( data[i] != (Q_INT8)0x00 )
+               break;
+       case (Q_INT8)0x04:
+       case (Q_INT8)0x07:
+               while( (const char)data[i] != (Q_INT8)0x00 )
                        server += data[i++];
                kdDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "Server:" << server 
<< endl;
-//             server = server.mid( 4, server.find( '0', 4) );
+               if( server.isEmpty() )
+               {
+                       emit webcamNotAvailable(socketMap[socket].sender);
+                       break;
+               }
                
                kdDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "Connecting to " << 
server << endl;
-               KStreamSocket *newSocket = new KStreamSocket( server, 
QString::number(5100) );
+               newSocket = new KStreamSocket( server, QString::number(5100) );
                socketMap[newSocket] = socketMap[socket];
                newSocket->enableRead( true );
                connect( newSocket, SIGNAL( connected( const KResolverEntry& ) 
), this, SLOT( slotConnectionStage2Established() ) );
 @ -260,6 +268,9  @
                }
                
                newSocket->connect();   
+               break;
+       default:
+               break;
        }
        socketMap.remove( socket );
        delete socket;
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp 
#574053:574054
 @ -309,7 +309,9  @
 //                              SLOT(slotGotIdentities( const QStringList&)));
                
                QObject::connect(m_session, SIGNAL(gotWebcamInvite(const 
QString&)), this, SLOT(slotGotWebcamInvite(const QString&)));
-                               
+               
+               QObject::connect(m_session, SIGNAL(webcamNotAvailable(const 
QString&)), this, SLOT(slotWebcamNotAvailable(const QString&)));
+               
                QObject::connect(m_session, SIGNAL(webcamImageReceived(const 
QString&, const QPixmap& )), this, SLOT(slotGotWebcamImage(const QString&, 
const QPixmap& )));
                
                QObject::connect(m_session, SIGNAL(webcamClosed(const QString&, 
int )), this, SLOT(slotWebcamClosed(const QString&, int )));
 @ -437,6 +439,8  @
                
                QObject::disconnect(m_session, SIGNAL(gotWebcamInvite(const 
QString&)), this, SLOT(slotGotWebcamInvite(const QString&)));
                
+               QObject::disconnect(m_session, SIGNAL(webcamNotAvailable(const 
QString&)), this, SLOT(slotWebcamNotAvailable(const QString&)));
+               
                QObject::disconnect(m_session, SIGNAL(webcamImageReceived(const 
QString&, const QPixmap& )), this, SLOT(slotGotWebcamImage(const QString&, 
const QPixmap& )));
                
                QObject::disconnect(m_session, SIGNAL(webcamClosed(const 
QString&, int )), this, SLOT(slotWebcamClosed(const QString&, int )));
 @ -1487,10 +1491,22  @
                return;
        }
        
+       if( m_pendingWebcamInvites.contains( who ) )
+               return;
+       
+       m_pendingWebcamInvites.append( who );
+       
        if( KMessageBox::Yes == KMessageBox::questionYesNo( 
Kopete::UI::Global::mainWidget(), i18n("%1 has invited you to view his/her 
webcam. Accept?")
-                                                       .arg(who), 
QString::null, i18n("Accept"), i18n("Ignore") ) )    
+                                                       .arg(who), 
QString::null, i18n("Accept"), i18n("Ignore") ) )
+       {
+               m_pendingWebcamInvites.remove( who );
                m_session->requestWebcam( who );
+       }
 }
+void YahooAccount::slotWebcamNotAvailable( const QString &who )
+{
+       KMessageBox::sorry( Kopete::UI::Global::mainWidget(), i18n("Webcam for 
%1 is not available.").arg(who), i18n( "Yahoo Plugin" ) );
+}
 
 void YahooAccount::slotGotWebcamImage( const QString& who, const QPixmap& 
image )
 {
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/yahooaccount.h 
#574053:574054
 @ -211,6 +211,7  @
        void slotRemoveHandler(int fd);
        //void slotHostConnect(const QString &host, int port);
        void slotGotWebcamInvite(const QString &);
+       void slotWebcamNotAvailable( const QString &who );
        void slotGotWebcamImage(const QString&, const QPixmap&);
        void slotWebcamReadyForTransmission();
        void slotWebcamStopTransmission();
 @ -264,6 +265,7  @
         */
        QMap<QString, YahooConferenceChatSession *> m_conferences;
        QStringList m_pendingConfInvites;
+       QStringList m_pendingWebcamInvites;
 
        QMap<unsigned int, Kopete::Transfer *> m_fileTransfers;
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to