From: <arn...@us...> - 2006-06-06 02:30:44
|
Revision: 612 Author: arnetheduck Date: 2006-06-03 14:38:06 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=612&view=rev Log Message: ----------- bot detection fix Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/client/User.cpp dcplusplus/trunk/client/User.h dcplusplus/trunk/help/changelog.html Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/Example.xml 2006-06-03 21:38:06 UTC (rev 612) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.69" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.691" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/changelog.txt 2006-06-03 21:38:06 UTC (rev 612) @@ -1,4 +1,4 @@ --- 0.691 -- +-- 0.691 2006-06-03 -- * Links to bugzilla in html changelog * [bug 122] Added userlist filter (thanks trem) * [bug 578] Added search for alternates to transfers menu (thanks trem) @@ -12,7 +12,8 @@ * Added "all" to hub list field search (thanks trem) * Fixed bug when sending active ADC search results * Updated to ADC 0.11 -* Passive users now also get search results +* Passive users now also get ADC search results +* Changed nmdc bot-detection to what it was before, should fix pm-to-bot bug -- 0.69 2006-05-21 -- * Small linux / old gcc fixes (thanks jens oknelid) Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 21:38:06 UTC (rev 612) @@ -119,6 +119,12 @@ u->getIdentity().set(i->c_str(), i->substr(2)); } + if(u->getIdentity().isBot()) { + u->getUser()->setFlag(User::BOT); + } else { + u->getUser()->unsetFlag(User::BOT); + } + if(u->getUser()->getFirstNick().empty()) { u->getUser()->setFirstNick(u->getIdentity().getNick()); } Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-06-03 21:38:06 UTC (rev 612) @@ -93,8 +93,6 @@ getMyIdentity().setHubUrl(getHubUrl()); } else { p = ClientManager::getInstance()->getUser(aNick, getHubUrl()); - // In NMDC, everyone's a bot until they show a good myinfo - p->setFlag(User::BOT); } { @@ -319,8 +317,6 @@ OnlineUser& u = getUser(nick); - u.getUser()->unsetFlag(User::BOT); - j = param.find('$', i); if(j == string::npos) return; @@ -342,7 +338,15 @@ if(j == string::npos) return; - u.getIdentity().setConnection(param.substr(i, j-i-1)); + string connection = param.substr(i, j-i-1); + if(connection.empty()) { + // No connection = bot... + u.getUser()->setFlag(User::BOT); + } else { + u.getUser()->unsetFlag(User::BOT); + } + + u.getIdentity().setConnection(connection); i = j + 1; j = param.find('$', i); Modified: dcplusplus/trunk/client/User.cpp =================================================================== --- dcplusplus/trunk/client/User.cpp 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/User.cpp 2006-06-03 21:38:06 UTC (rev 612) @@ -55,8 +55,8 @@ } } -const bool Identity::supports(const string& name) const { - string su = get("SU"); +bool Identity::supports(const string& name) const { + const string& su = get("SU"); StringTokenizer<string> st(su, ','); for(StringIter i = st.getTokens().begin(); i != st.getTokens().end(); ++i) { if(*i == name) Modified: dcplusplus/trunk/client/User.h =================================================================== --- dcplusplus/trunk/client/User.h 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/User.h 2006-06-03 21:38:06 UTC (rev 612) @@ -124,12 +124,13 @@ get("HR") + "/" + get("HO") + ",S:" + get("SL") + ">"; } - const bool supports(const string& name) const; - const bool isHub() const { return !get("HU").empty(); } - const bool isOp() const { return !get("OP").empty(); } - const bool isHidden() const { return !get("HI").empty(); } - const bool isTcpActive() const { return !getIp().empty() || (user->isSet(User::NMDC) && !user->isSet(User::PASSIVE)); } - const bool isUdpActive() const { return !getIp().empty() && !getUdpPort().empty(); } + bool supports(const string& name) const; + bool isHub() const { return !get("HU").empty(); } + bool isOp() const { return !get("OP").empty(); } + bool isHidden() const { return !get("HI").empty(); } + bool isBot() const { return !get("BO").empty(); } + bool isTcpActive() const { return !getIp().empty() || (user->isSet(User::NMDC) && !user->isSet(User::PASSIVE)); } + bool isUdpActive() const { return !getIp().empty() && !getUdpPort().empty(); } const string& get(const char* name) const { InfMap::const_iterator i = info.find(*(short*)name); Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/help/changelog.html 2006-06-03 21:38:06 UTC (rev 612) @@ -13,6 +13,25 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. +<h2>0.691 <span style="color: gray;">(2006-06-03)</span></h2> +<ul> + <li>Links to bugzilla in html changelog</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=122">[bug 122]</a> Added userlist filter (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=578">[bug 578]</a> Added search for alternates to transfers menu (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=861">[bug 861]</a> Fixed auto-prio not being set correctly (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=878">[bug 878]</a> Added close all ... to window menu (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=903">[bug 903]</a> Holding shift while minimizing will use opposite tray setting (thanks joakim tosteberg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=923">[bug 923]</a> PM history always read (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=927">[bug 927]</a> Fixed OP detection bug (thanks pothead)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=929">[bug 929]</a> Fixed list view flicker issues (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=931">[bug 931]</a> Improved keyboard navigation (thanks trem)</li> + <li>Added "all" to hub list field search (thanks trem)</li> + <li>Fixed bug when sending active ADC search results</li> + <li>Updated to ADC 0.11</li> + <li>Passive users now also get ADC search results</li> + <li>Changed nmdc bot-detection to what it was before, should fix pm-to-bot bug</li> +</ul> + <h2>0.69 <span style="color: gray;">(2006-05-21)</span></h2> <ul> <li>Small linux / old gcc fixes (thanks jens oknelid)</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |