[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenetwork/kopete/protocols/oscar
From: Matt Rogers <mattr () kde ! org>
Date: 2005-04-01 19:14:33
Message-ID: 20050401191433.CA70D490 () office ! kde ! org
[Download RAW message or body]
CVS commit by mattr:
add an accessor for client name. UserDetails::detectClient is completly bogus now,
need to find a clever way to do this. Add some stuff that should display the client
name in the tooltip once we get detectClient sorted out.
M +5 -0 icq/icqcontact.cpp 1.74
M +20 -7 liboscar/userdetails.cpp 1.4
M +1 -0 liboscar/userdetails.h 1.5
--- kdenetwork/kopete/protocols/oscar/icq/icqcontact.cpp #1.73:1.74
@@ -102,4 +102,9 @@ void ICQContact::userInfoUpdated( const
setOnlineStatus( presence.toOnlineStatus() );
+ if ( details.clientName().isEmpty() )
+ removeProperty( mProtocol->clientFeatures );
+ else
+ setProperty( mProtocol->clientFeatures, details.clientName() );
+
OscarContact::userInfoUpdated( contact, details );
}
--- kdenetwork/kopete/protocols/oscar/liboscar/userdetails.cpp #1.3:1.4
@@ -106,4 +106,9 @@ QByteArray UserDetails::buddyIconHash()
}
+QString UserDetails::clientName() const
+{
+ return (m_clientName + m_clientVersion);
+}
+
void UserDetails::fill( Buffer * buffer )
{
@@ -237,4 +243,5 @@ void UserDetails::detectClient()
* without sim-icq I would have only checked for the capabilities
*/
+ /*
bool clientMatched = false;
if (m_capabilities != 0)
@@ -244,25 +251,25 @@ void UserDetails::detectClient()
{
m_clientName=i18n("Kopete");
- clientMatched=true;
+ return;
}
else if (hasCap(CAP_MICQ))
{
m_clientName=i18n("MICQ");
- clientMatched=true;
+ return;
}
else if (hasCap(CAP_SIMNEW) || hasCap(CAP_SIMOLD))
{
m_clientName=i18n("SIM");
- clientMatched=true;
+ return;
}
else if (hasCap(CAP_TRILLIANCRYPT) || hasCap(CAP_TRILLIAN))
{
m_clientName=i18n("Trillian");
- clientMatched=true;
+ return;
}
else if (hasCap(CAP_MACICQ))
{
m_clientName=i18n("MacICQ");
- clientMatched=true;
+ return;
}
else if ((m_dcLastInfoUpdateTime & 0xFF7F0000L) == 0x7D000000L)
@@ -278,5 +285,5 @@ void UserDetails::detectClient()
else
m_clientVersion.sprintf("%d%u", ver/1000, \
(ver/10)%100);
- clientMatched=true;
+ return;
}
else // some client we could not detect using capabilities
@@ -391,9 +398,15 @@ void UserDetails::detectClient()
}
}
+
+ kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "detected client as: " << \
m_clientName + << " " << m_clientVersion << endl;
+ */
}
bool UserDetails::hasCap( int capNumber )
{
- return ( m_capabilities & ( 1 << capNumber ) ) != 0;
+ bool capPresent = ( m_capabilities & ( 1 << capNumber ) ) == ( 1 << \
capNumber ); + kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "have cap " << \
Oscar::capName( capNumber ) << capPresent << endl; + return capPresent;
}
--- kdenetwork/kopete/protocols/oscar/liboscar/userdetails.h #1.4:1.5
@@ -46,4 +46,5 @@ public:
DWORD extendedStatus() const; //!User status accessor
QByteArray buddyIconHash() const; //! Buddy icon md5 hash accessor
+ QString clientName() const; //! Client name and version
/**
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic