From: <arn...@us...> - 2006-07-12 20:13:19
|
Revision: 640 Author: arnetheduck Date: 2006-07-12 13:12:22 -0700 (Wed, 12 Jul 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=640&view=rev Log Message: ----------- badpassword, move file Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/Client.cpp dcplusplus/trunk/client/Client.h dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/changelog.txt 2006-07-12 20:12:22 UTC (rev 640) @@ -4,6 +4,8 @@ * [bug 125] Fixed out-of-order PM/quit * [bug 224] Slots are no longer granted to disconnected users, instead disconnection is delayed a minute * [NMDC] Fixed extra space in chat +* [bug 395] Fixed password being blanked +* [bug 419] Allowed changing case only when moving file in queue -- 0.694 2006-07-10 -- * Fixed crash in certificates page Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-07-12 20:12:22 UTC (rev 640) @@ -343,6 +343,12 @@ if(!u) return; + int severity = Util::toInt(c.getParam(0).substr(0, 1)); + int code = Util::toInt(c.getParam(0).substr(1)); + + if(code == AdcCommand::ERROR_BAD_PASSWORD) { + setPassword(Util::emptyString); + } // @todo Check for invalid protocol and unset TLS if necessary fire(ClientListener::Message(), this, *u, c.getParam(1)); } Modified: dcplusplus/trunk/client/Client.cpp =================================================================== --- dcplusplus/trunk/client/Client.cpp 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/client/Client.cpp 2006-07-12 20:12:22 UTC (rev 640) @@ -73,7 +73,8 @@ } else { setCurrentDescription(SETTING(DESCRIPTION)); } - setPassword(hub->getPassword()); + if(!hub->getPassword().empty()) + setPassword(hub->getPassword()); } else { if(updateNick) { setCurrentNick(checkNick(SETTING(NICK))); Modified: dcplusplus/trunk/client/Client.h =================================================================== --- dcplusplus/trunk/client/Client.h 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/client/Client.h 2006-07-12 20:12:22 UTC (rev 640) @@ -38,7 +38,6 @@ typedef X<0> Connecting; typedef X<1> Connected; - typedef X<2> BadPassword; typedef X<3> UserUpdated; typedef X<4> UsersUpdated; typedef X<5> UserRemoved; @@ -58,7 +57,6 @@ virtual void on(Connecting, Client*) throw() { } virtual void on(Connected, Client*) throw() { } - virtual void on(BadPassword, Client*) throw() { } virtual void on(UserUpdated, Client*, const OnlineUser&) throw() { } virtual void on(UsersUpdated, Client*, const OnlineUser::List&) throw() { } virtual void on(UserRemoved, Client*, const OnlineUser&) throw() { } Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-07-12 20:12:22 UTC (rev 640) @@ -708,7 +708,7 @@ setMyIdentity(ou.getIdentity()); fire(ClientListener::GetPassword(), this); } else if(cmd == "$BadPass") { - fire(ClientListener::BadPassword(), this); + setPassword(Util::emptyString); } else if(cmd == "$ZOn") { socket->setMode(BufferedSocket::MODE_ZPIPE); } else { Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-07-12 20:12:22 UTC (rev 640) @@ -699,7 +699,7 @@ void QueueManager::move(const string& aSource, const string& aTarget) throw() { string target = Util::validateFileName(aTarget); - if(Util::stricmp(aSource, target) == 0) + if(aSource == target) return; bool delSource = false; @@ -717,7 +717,7 @@ // Let's see if the target exists...then things get complicated... QueueItem* qt = fileQueue.find(target); - if(qt == NULL) { + if(qt == NULL || Util::stricmp(aSource, target) == 0) { // Good, update the target and move in the queue... fileQueue.move(qs, target); fire(QueueManagerListener::Moved(), qs); Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-07-12 20:12:22 UTC (rev 640) @@ -1221,9 +1221,6 @@ void HubFrame::on(Connected, Client*) throw() { speak(CONNECTED); } -void HubFrame::on(BadPassword, Client*) throw() { - client->setPassword(Util::emptyString); -} void HubFrame::on(UserUpdated, Client*, const OnlineUser& user) throw() { speak(UPDATE_USER_JOIN, user); } Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-07-12 11:34:22 UTC (rev 639) +++ dcplusplus/trunk/windows/HubFrame.h 2006-07-12 20:12:22 UTC (rev 640) @@ -391,7 +391,6 @@ // ClientListener virtual void on(Connecting, Client*) throw(); virtual void on(Connected, Client*) throw(); - virtual void on(BadPassword, Client*) throw(); virtual void on(UserUpdated, Client*, const OnlineUser&) throw(); virtual void on(UsersUpdated, Client*, const OnlineUser::List&) throw(); virtual void on(UserRemoved, Client*, const OnlineUser&) throw(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |