← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3039: remove /raw, will be in the dev plugin

 

------------------------------------------------------------
revno: 3039
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2012-09-09 16:05:30 +0200
message:
  remove /raw, will be in the dev plugin
modified:
  dcpp/Util.cpp
  dcpp/Util.h
  help/chat_commands.html
  win32/HubFrame.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 'dcpp/Util.cpp'
--- dcpp/Util.cpp	2012-07-18 02:09:39 +0000
+++ dcpp/Util.cpp	2012-09-09 14:05:30 +0000
@@ -198,46 +198,6 @@
 
 }
 
-string Util::convertCEscapes(string tmp)
-{
-	string::size_type i = 0;
-	while( (i = tmp.find('\\', i)) != string::npos) {
-		switch(tmp[i + 1]) {
-			case '\0':
-				return tmp;
-				break;
-			case 'a': tmp.replace(i, 2, "\a"); break;
-			case 'b': tmp.replace(i, 2, "\b"); break;
-			case 'e': tmp.replace(i, 2, "\033"); break;
-			case 'f': tmp.replace(i, 2, "\f"); break;
-			case 'n': tmp.replace(i, 2, "\n"); break;
-			case 'r': tmp.replace(i, 2, "\r"); break;
-			case 't': tmp.replace(i, 2, "\t"); break;
-			case 'v': tmp.replace(i, 2, "\v"); break;
-			case '\\': tmp.replace(i, 2, "\\"); break;
-			case 'x':
-				if(i < tmp.length() - 3) {
-					int num = strtol(tmp.substr(i + 2, 2).c_str(), NULL, 16);
-					tmp.replace(i, 4, string(1, (char)num));
-				}
-				break;
-			default:
-				if(tmp[i + 1] >= '0' && tmp[i + 1] <= '7') {
-					int c = 1;
-					if(tmp[i + 2] >= '0' && tmp[i + 2] <= '7') {
-						++c;
-						if(tmp[i + 1] <= '3' && tmp[i + 3] >= '0' && tmp[i + 3] <= '7')
-							++c;
-					}
-					int num = strtol(tmp.substr(i + 1, c).c_str(), NULL, 8);
-					tmp.replace(i, c + 1, string(1, (char)num));
-				}
-		}
-		i += 1;
-	}
-	return tmp;
-}
-
 void Util::migrate(const string& file) {
 	if(localMode) {
 		return;

=== modified file 'dcpp/Util.h'
--- dcpp/Util.h	2012-07-18 02:09:39 +0000
+++ dcpp/Util.h	2012-09-09 14:05:30 +0000
@@ -440,8 +440,6 @@
 	static int stricmp(const wstring& a, const wstring& b) { return stricmp(a.c_str(), b.c_str()); }
 	static int strnicmp(const wstring& a, const wstring& b, size_t n) { return strnicmp(a.c_str(), b.c_str(), n); }
 
-	static string convertCEscapes(string tmp);
-
 	static bool getAway();
 	static void incAway();
 	static void decAway();

=== modified file 'help/chat_commands.html'
--- help/chat_commands.html	2012-09-04 21:10:41 +0000
+++ help/chat_commands.html	2012-09-09 14:05:30 +0000
@@ -45,8 +45,6 @@
   chat messages from the specified user.</dd>
   <dt><untranslated>/topic</untranslated></dt>
   <dd>Prints the current hub's topic. Useful if you want to copy the topic or it contains a link you'd like to easily open.</dd>
-  <dt><untranslated>/raw &lt;command&gt;</untranslated></dt>
-  <dd>Sends the specified raw protocol command to the current hub. Note that this is an advanced command for debugging purposes; improper use may result severe consequences like banning yourself from the hub.</dd>
 </dl>
 <h2>Private Message</h2>
 <dl style="margin-left: 40px;">

=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp	2012-09-03 19:14:25 +0000
+++ win32/HubFrame.cpp	2012-09-09 14:05:30 +0000
@@ -495,16 +495,14 @@
 				openLog();
 			else if(Util::stricmp(param.c_str(), _T("status")) == 0)
 				openLog(true);
-		} else if(Util::stricmp(cmd.c_str(), _T("raw")) == 0) {
-			client->send(Util::convertCEscapes(Text::fromT(param)));
 		} else if(Util::stricmp(cmd.c_str(), _T("topic")) == 0) {
-			addChat(_T("Current hub topic: " + Text::toT(client->getHubDescription())));
+			addChat(str(TF_("Current hub topic: %1%") % Text::toT(client->getHubDescription())));
 		} else if(Util::stricmp(cmd.c_str(), _T("help")) == 0) {
 			addChat(_T("*** ") + WinUtil::commands +
 				_T(", /join <hub-ip>, /showjoins, /favshowjoins, /close, /userlist, ")
 				_T("/conn[ection], /fav[orite], /removefav[orite], /info, ")
 				_T("/pm <user> [message], /getlist <user>, /ignore <user>, /unignore <user>, ")
-				_T("/log <status, system, downloads, uploads>, /raw <raw-command>, /topic"));
+				_T("/log <status, system, downloads, uploads>, /topic"));
 		} else if(Util::stricmp(cmd.c_str(), _T("pm")) == 0) {
 			string::size_type j = param.find(_T(' '));
 			if(j != string::npos) {