On Monday 05 May 2003 19:40, Juan F. Codagnone wrote: > qt-gui already shows the client information for others licq peers in user's > tooltip. This small patch extends that, so all the known clients are > showed, not just licq.
rediffed to HEAD. -- Buenos Aires, Argentina 11�C with winds at 20 km/h WSW
Index: include/licq_user.h
===================================================================
RCS file: /cvsroot/licq/licq/include/licq_user.h,v
retrieving revision 1.44
diff -u -d -p -r1.44 licq_user.h
--- include/licq_user.h 2 Jul 2003 04:41:02 -0000 1.44
+++ include/licq_user.h 10 Jul 2003 03:16:18 -0000
@@ -398,6 +398,7 @@ public:
char *IdString() { return m_szId; }
char *usprintf(const char *szFormat, unsigned long nFlags = 0);
+ const char *ClientInfo() { return m_szClientInfo; }
// General Info
void SetAlias (const char *n);// { SetString(&m_szAlias, n); SaveGeneralInfo(); }
@@ -476,6 +477,10 @@ public:
void ClearCustomAutoResponse() { SetCustomAutoResponse(""); }
void SetPPID(unsigned long n) { m_nPPID = n; }
void SetId(const char *s) { SetString(&m_szId, s); SaveLicqInfo(); }
+ void SetClientInfo(const char *s)
+ { free(m_szClientInfo);
+ if(s) m_szClientInfo = strdup(s); else m_szClientInfo = NULL;
+ }
// Status
unsigned short Status();
@@ -625,6 +630,7 @@ protected:
m_nSequence,
m_nGroups[2];
char m_nMode;
+ char *m_szClientInfo;
char *m_szAutoResponse;
char *m_szEncoding;
char *m_szCustomAutoResponse;
Index: plugins/qt-gui/src/userbox.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/userbox.cpp,v
retrieving revision 1.147
diff -u -d -p -r1.147 userbox.cpp
--- plugins/qt-gui/src/userbox.cpp 2 Jul 2003 04:41:02 -0000 1.147
+++ plugins/qt-gui/src/userbox.cpp 10 Jul 2003 03:16:27 -0000
@@ -1389,10 +1389,9 @@ void CUserView::maybeTip(const QPoint& c
QTextCodec * codec = UserCodec::codecForICQUser(u);
if (u != NULL)
{
- if (u->SecureChannelSupport() == SECURE_CHANNEL_SUPPORTED)
- s += tr("<br>Licq %1/SSL").arg(CUserEvent::LicqVersionToString(u->LicqVersion()));
- else if (u->SecureChannelSupport() == SECURE_CHANNEL_NOTSUPPORTED)
- s += tr("<br>Licq %1").arg(CUserEvent::LicqVersionToString(u->LicqVersion()));
+ const char *p = u->ClientInfo();
+ if( p )
+ s += "<br>" + QString(p).replace(' ', " ");
if (u->AutoResponse() && *u->AutoResponse() &&
item->m_nStatus != ICQ_STATUS_OFFLINE &&
Index: src/icqd-srv.cpp
===================================================================
RCS file: /cvsroot/licq/licq/src/icqd-srv.cpp,v
retrieving revision 1.116
diff -u -d -p -r1.116 icqd-srv.cpp
--- src/icqd-srv.cpp 2 Jul 2003 04:41:01 -0000 1.116
+++ src/icqd-srv.cpp 10 Jul 2003 03:16:35 -0000
@@ -1919,30 +1919,33 @@ void CICQDaemon::ProcessBuddyFam(CBuffer
char szExtraInfo[28] = { 0 };
if ((timestamp & 0xFFFF0000) == LICQ_WITHSSL)
- snprintf(szExtraInfo, 27, " [Licq %s/SSL]",
+ snprintf(szExtraInfo, 27, "Licq %s/SSL",
CUserEvent::LicqVersionToString(timestamp & 0xFFFF));
else if ((timestamp & 0xFFFF0000) == LICQ_WITHOUTSSL)
- snprintf(szExtraInfo, 27, " [Licq %s]",
+ snprintf(szExtraInfo, 27, "Licq %s",
CUserEvent::LicqVersionToString(timestamp & 0xFFFF));
else if (timestamp == 0xffffffff)
- strcpy(szExtraInfo, " [MIRANDA]");
+ strcpy(szExtraInfo, "MIRANDA");
else if (timestamp == 0xFFFFFF8F)
- strcpy(szExtraInfo, " [StrICQ]");
+ strcpy(szExtraInfo, "StrICQ");
else if (timestamp == 0xFFFFFF42)
- strcpy(szExtraInfo, " [mICQ]");
+ strcpy(szExtraInfo, "mICQ");
else if (timestamp == 0xFFFFFF7F)
- strcpy(szExtraInfo, " [&RQ]");
+ strcpy(szExtraInfo, "&RQ");
else if (timestamp == 0xFFFFFFAB)
- strcpy(szExtraInfo, " [YSM]");
+ strcpy(szExtraInfo, "YSM");
else
- strcpy(szExtraInfo, "");
+ szExtraInfo[0]=0;
szExtraInfo[27] = '\0';
+ u->SetClientInfo(szExtraInfo[0] ? szExtraInfo : NULL);
if (nOldStatus != nNewStatus)
{
ChangeUserStatus(u, nNewStatus);
- gLog.Info("%s%s (%s) changed status: %s (v%01x)%s.\n", L_SRVxSTR, u->GetAlias(),
- u->IdString(), u->StatusStr(), tcpVersion & 0x0F, szExtraInfo);
+ gLog.Info("%s%s (%s) changed status: %s (v%01x)%c%s%c.\n",
+ L_SRVxSTR, u->GetAlias(), u->IdString(), u->StatusStr(),
+ tcpVersion & 0x0F, szExtraInfo[0] ? '[' : ' ',
+ szExtraInfo, szExtraInfo[0] ? ']' : '\0');
if ( (nNewStatus & ICQ_STATUS_FxUNKNOWNxFLAGS) )
gLog.Unknown("%sUnknown status flag for %s (%s): 0x%08lX\n",
L_UNKNOWNxSTR, u->GetAlias(), u->IdString(),
Index: src/user.cpp
===================================================================
RCS file: /cvsroot/licq/licq/src/user.cpp,v
retrieving revision 1.76
diff -u -d -p -r1.76 user.cpp
--- src/user.cpp 2 Jul 2003 04:41:01 -0000 1.76
+++ src/user.cpp 10 Jul 2003 03:16:35 -0000
@@ -1592,6 +1592,7 @@ ICQUser::~ICQUser()
free( m_szAbout );
if ( m_szCustomAutoResponse )
free( m_szCustomAutoResponse );
+ free( m_szClientInfo );
if ( m_szId )
free( m_szId );
/*
@@ -1732,6 +1733,7 @@ void ICQUser::Init(const char *_szId, un
m_bAwaitingAuth = false;
m_nSID[0] = m_nSID[1] = m_nSID[2] = 0;
m_nGSID = 0;
+ m_szClientInfo = NULL;
snprintf(m_szUinString, 12, "%lu", m_nUin);
m_szUinString[12] = '\0';
pgp00000.pgp
Description: signature
