------- 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=120790         




------- Additional Comments From michael.larouche kdemail net  2006-02-04 22:39 
-------
SVN commit 505782 by mlarouche:

Backport to KDE 3.5 branch:

Do not reports that the user has a webcam when it is not configured or 
available.

CCBUG: 120790



 M  +21 -0     msnaccount.cpp  
 M  +11 -0     msnaccount.h  
 M  +1 -1      msnnotifysocket.cpp  
 M  +0 -8      msnprotocol.cpp  
 M  +0 -2      msnprotocol.h  


--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/msnaccount.cpp 
#505781:505782
 @ -19,6 +19,8  @
 
 #include "msnaccount.h"
 
+#include <config.h>
+
 #include <kaction.h>
 #include <kconfig.h>
 #include <kdebug.h>
 @ -54,6 +56,9  @
 #include <kglobal.h>
 #endif
 
+#if MSN_WEBCAM
+#include "avdevice/videodevicepool.h"
+#endif
 MSNAccount::MSNAccount( MSNProtocol *parent, const QString& AccountID, const 
char *name )
        : Kopete::PasswordedAccount ( parent, AccountID.lower(), 0, name )
 {
 @ -103,6 +108,17  @
                if ( !groupGuid.isEmpty() )
                        m_groupList.insert( groupGuid , g );
        }
+
+       // Set the client Id for the myself contact.  It sets what MSN feature 
we support.
+       m_clientId = MSNProtocol::MSNC4 | MSNProtocol::InkFormatGIF | 
MSNProtocol::SupportMultiPacketMessaging;
+
+#if MSN_WEBCAM
+       Kopete::AV::VideoDevicePool::self()->scanDevices();
+       if( Kopete::AV::VideoDevicePool::self()->hasDevices() )
+       {
+               m_clientId |= MSNProtocol::SupportWebcam;
+       }
+#endif
 }
 
 
 @ -121,6 +137,11  @
        return configGroup()->readBoolEntry(  "useHttpMethod" , false );
 }
 
+QString MSNAccount::myselfClientId() const
+{
+       return QString::number(m_clientId, 10);
+}
+
 void MSNAccount::connectWithPassword( const QString &passwd )
 {
        m_newContactList=false;
--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/msnaccount.h #505781:505782
 @ -102,6 +102,12  @
 
        //END
 
+       /**
+        * Return the client ID for the myself contact of this account.
+        * It is dynamic to see if we really have a webcam or not.
+        */
+       QString myselfClientId() const;
+
 public slots:
        virtual void connectWithPassword( const QString &password ) ;
        virtual void disconnect() ;
 @ -250,6 +256,11  @
         * I would like an API to request the password WITHOUT askling it.
         */
        QString m_password;
+
+       /**
+        * Cliend ID is a bitfield that contains supported features for a MSN 
contact.
+        */
+       uint m_clientId;
 };
 
 #endif
--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/msnnotifysocket.cpp 
#505781:505782
 @ -998,7 +998,7  @
        if( onlineStatus() == Disconnected )
                m_newstatus = status;
        else
-               sendCommand( "CHG", statusToString( status ) + " " + 
MSNProtocol::protocol()->clientId() + " " + escape(m_account->pictureObject()) 
);
+               sendCommand( "CHG", statusToString( status ) + " " + 
m_account->myselfClientId() + " " + escape(m_account->pictureObject()) );
 }
 
 void MSNNotifySocket::changePublicName( const QString &publicName, const 
QString &handle )
--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/msnprotocol.cpp 
#505781:505782
 @ -74,9 +74,6  @
 
        setCapabilities( Kopete::Protocol::BaseFgColor | 
Kopete::Protocol::BaseFont | Kopete::Protocol::BaseFormatting );
 
-       // Build the MSN clientId. It sets what MSN feature we support.
-       m_clientId = MSNC4 | InkFormatGIF | SupportMultiPacketMessaging  | 
SupportWebcam;
-
        // m_status = m_unknownStatus = UNK;
 }
 
 @ -160,11 +157,6  @
        return ( userid.contains(' ') ==1 && userid.contains('.') >=1 && 
userid.contains(' ') == 0);
 }
 
-QString MSNProtocol::clientId()
-{
-       return QString::number(m_clientId, 10);
-}
-
 QImage MSNProtocol::scalePicture(const QImage &picture)
 {
        QImage img(picture);
--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/msnprotocol.h 
#505781:505782
 @ -158,7 +158,6  @
 
        static MSNProtocol* protocol();
        static bool validContactId(const QString&);
-       QString clientId();
        QImage scalePicture(const QImage &picture);
 
 private slots:
 @ -167,7 +166,6  @
 private:
 
        static MSNProtocol *s_protocol;
-       uint m_clientId;
 
 signals:
        /**
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to