linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #04294
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2576: Separate application and version in INF
------------------------------------------------------------
revno: 2576
author: Ullner <ullner@xxxxxxxxx>
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2011-07-03 19:15:51 +0200
message:
Separate application and version in INF
modified:
changelog.txt
dcpp/AdcHub.cpp
dcpp/OnlineUser.h
dcpp/User.cpp
win32/HubFrame.cpp
win32/UsersFrame.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt 2011-06-28 20:07:49 +0000
+++ changelog.txt 2011-07-03 17:15:51 +0000
@@ -32,6 +32,7 @@
* Update OpenSSL to version 1.0.0d
* [L#189241] Store crash reports in a CrashLog.txt file (poy)
* Improve "View as text" windows (poy)
+* [L#804024] [ADC] Separate application and version in INF (ullner)
-- 0.782 2011-03-05 --
* Prevent a remote crash triggered via malformed user commands (poy)
=== modified file 'dcpp/AdcHub.cpp'
--- dcpp/AdcHub.cpp 2011-04-13 19:16:51 +0000
+++ dcpp/AdcHub.cpp 2011-07-03 17:15:51 +0000
@@ -967,7 +967,8 @@
addParam(lastInfoMap, c, "HN", Util::toString(counts[COUNT_NORMAL]));
addParam(lastInfoMap, c, "HR", Util::toString(counts[COUNT_REGISTERED]));
addParam(lastInfoMap, c, "HO", Util::toString(counts[COUNT_OP]));
- addParam(lastInfoMap, c, "VE", "++ " VERSIONSTRING);
+ addParam(lastInfoMap, c, "AP", "++");
+ addParam(lastInfoMap, c, "VE", VERSIONSTRING);
addParam(lastInfoMap, c, "AW", Util::getAway() ? "1" : Util::emptyString);
int limit = ThrottleManager::getInstance()->getDownLimit();
=== modified file 'dcpp/OnlineUser.h'
--- dcpp/OnlineUser.h 2011-05-28 15:31:50 +0000
+++ dcpp/OnlineUser.h 2011-07-03 17:15:51 +0000
@@ -78,6 +78,7 @@
void setBot(bool bot) { set("BO", bot ? "1" : Util::emptyString); }
void setHidden(bool hidden) { set("HI", hidden ? "1" : Util::emptyString); }
string getTag() const;
+ string getApplication() const;
const string& getCountry() const;
bool supports(const string& name) const;
bool isHub() const { return isClientType(CT_HUB) || isSet("HU"); }
=== modified file 'dcpp/User.cpp'
--- dcpp/User.cpp 2011-04-13 19:16:51 +0000
+++ dcpp/User.cpp 2011-07-03 17:15:51 +0000
@@ -84,8 +84,24 @@
return get("TA");
if(get("VE").empty() || get("HN").empty() || get("HR").empty() ||get("HO").empty() || get("SL").empty())
return Util::emptyString;
- return "<" + get("VE") + ",M:" + string(isTcpActive() ? "A" : "P") + ",H:" + get("HN") + "/" +
- get("HR") + "/" + get("HO") + ",S:" + get("SL") + ">";
+ return "<" + getApplication() + ",M:" + string(isTcpActive() ? "A" : "P") +
+ ",H:" + get("HN") + "/" + get("HR") + "/" + get("HO") + ",S:" + get("SL") + ">";
+}
+
+string Identity::getApplication() const {
+ auto application = get("AP");
+ auto version = get("VE");
+
+ if(version.empty()) {
+ return application;
+ }
+
+ if(application.empty()) {
+ // AP is an extension, so we can't guarantee that the other party supports it, so default to VE.
+ return version;
+ }
+
+ return application + ' ' + version;
}
const string& Identity::getCountry() const {
=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp 2011-06-24 16:31:14 +0000
+++ win32/HubFrame.cpp 2011-07-03 17:15:51 +0000
@@ -836,9 +836,9 @@
}
hubName += " (" + client->getHubUrl() + ")";
#ifdef _DEBUG
- string version = client->getHubIdentity().get("VE");
- if(!version.empty()) {
- hubName += " - " + version;
+ auto application = client->getHubIdentity().getApplication();
+ if(!application.empty()) {
+ hubName += " - " + application;
}
#endif
tstring hubNameT = Text::toT(hubName);
=== modified file 'win32/UsersFrame.cpp'
--- win32/UsersFrame.cpp 2011-05-04 19:32:00 +0000
+++ win32/UsersFrame.cpp 2011-07-03 17:15:51 +0000
@@ -89,7 +89,8 @@
{ "U4", T_("Search port (v4)"), &Text::toT },
{ "U6", T_("Search port (v6)"), &Text::toT },
{ "SU", T_("Features"), &Text::toT },
- { "VE", T_("Client"), &Text::toT },
+ { "VE", T_("Application version"), &Text::toT },
+ { "AP", T_("Application"), &Text::toT },
{ "ID", T_("CID"), &Text::toT },
{ "KP", T_("TLS Keyprint"), &Text::toT },