diff --exclude='*orig' -Naur psi-0.10-test3-orig/src/common.h psi-0.10-test3/src/common.h --- psi-0.10-test3-orig/src/common.h 2005-11-08 20:37:15.000000000 +0000 +++ psi-0.10-test3/src/common.h 2005-11-08 20:40:41.000000000 +0000 @@ -260,6 +260,11 @@ QValueVector fortunes; + bool spoofClient; + QString spoofClientName; + QString spoofClientVersion; + QString spoofClientOS; + // Last used path remembering QString lastPath; QString lastSavePath; diff --exclude='*orig' -Naur psi-0.10-test3-orig/src/psiaccount.cpp psi-0.10-test3/src/psiaccount.cpp --- psi-0.10-test3-orig/src/psiaccount.cpp 2005-11-08 18:25:39.000000000 +0000 +++ psi-0.10-test3/src/psiaccount.cpp 2005-11-08 20:40:41.000000000 +0000 @@ -441,10 +441,19 @@ // create Jabber::Client d->client = new Client; - d->client->setOSName(getOSName()); d->client->setTimeZone(getTZString(), getTZOffset()); - d->client->setClientName(PROG_NAME); - d->client->setClientVersion(PROG_VERSION); + if (option.spoofClient) + { + d->client->setOSName(option.spoofClientOS); + d->client->setClientName(option.spoofClientName); + d->client->setClientVersion(option.spoofClientVersion); + } + else + { + d->client->setOSName(getOSName()); + d->client->setClientName(PROG_NAME); + d->client->setClientVersion(PROG_VERSION); + } d->client->setFileTransferEnabled(true); @@ -1357,8 +1366,12 @@ UserResource ur(res); //ur.setSecurityEnabled(true); - if(local) - ur.setClient(PROG_NAME,PROG_VERSION,getOSName()); + if(local) { + if (option.spoofClient) + ur.setClient(option.spoofClientName, option.spoofClientVersion, option.spoofClientOS); + else + ur.setClient(PROG_NAME,PROG_VERSION,getOSName()); + } rp = &(*u->userResourceList().append(ur)); if(notifyOnlineOk && !local) { diff --exclude='*orig' -Naur psi-0.10-test3-orig/src/psicon.h psi-0.10-test3/src/psicon.h --- psi-0.10-test3-orig/src/psicon.h 2005-11-08 18:25:36.000000000 +0000 +++ psi-0.10-test3/src/psicon.h 2005-11-08 20:40:41.000000000 +0000 @@ -74,6 +74,11 @@ PsiCon *psi; PsiAccount *pa; bool onlineOnly; + + bool spoofClient; + QString spoofClientName; + QString spoofClientVersion; + QString spoofClientOS; }; class PsiCon : public QObject diff --exclude='*orig' -Naur psi-0.10-test3-orig/src/psi_profiles.cpp psi-0.10-test3/src/psi_profiles.cpp --- psi-0.10-test3-orig/src/psi_profiles.cpp 2005-11-08 20:37:15.000000000 +0000 +++ psi-0.10-test3/src/psi_profiles.cpp 2005-11-08 20:40:41.000000000 +0000 @@ -688,6 +688,12 @@ prefs.avatarsChatdlgEnabled = true; prefs.avatarsSize = 48; + // kg: client spoofing + prefs.spoofClient = false; + prefs.spoofClientName = ""; + prefs.spoofClientVersion = ""; + prefs.spoofClientOS = ""; + // global accelerators prefs.globalAccels.clear(); prefs.globalAccels.append(QKeySequence()); // process next event @@ -1424,6 +1430,16 @@ p.appendChild(e); } + { + // kg: client spoofing + QDomElement p_spoof = doc.createElement("spoofClient"); + p.appendChild(p_spoof); + setBoolAttribute(p_spoof, "enabled", prefs.spoofClient); + p_spoof.appendChild( textTag(doc, "name", prefs.spoofClientName ) ); + p_spoof.appendChild( textTag(doc, "version", prefs.spoofClientVersion ) ); + p_spoof.appendChild( textTag(doc, "os", prefs.spoofClientOS ) ); + } + QFile f(fname); if(!f.open(IO_WriteOnly)) return FALSE; @@ -2207,6 +2223,18 @@ GAdvancedWidget::setStickToWindows( toWindows ); } } + + QDomElement p_spoof = findSubTag(p, "spoofClient", &found); + if (found) { + //kg: client spoofing + if(p_spoof.hasAttribute("enabled")) + readBoolAttribute(p_spoof, "enabled", &prefs.spoofClient); + else + prefs.spoofClient = FALSE; + readEntry(p_spoof, "name", &prefs.spoofClientName); + readEntry(p_spoof, "version", &prefs.spoofClientVersion); + readEntry(p_spoof, "os", &prefs.spoofClientOS); + } } return TRUE;