← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2714: add /ignore & /unignore

 

------------------------------------------------------------
revno: 2714
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2011-12-11 15:45:53 +0100
message:
  add /ignore & /unignore
modified:
  help/chat_commands.html
  help/commands_user_general.inc
  win32/HubFrame.cpp
  win32/PrivateFrame.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 'help/chat_commands.html'
--- help/chat_commands.html	2011-11-29 17:27:23 +0000
+++ help/chat_commands.html	2011-12-11 14:45:53 +0000
@@ -37,6 +37,12 @@
 the message, if one was specified.</dd>
   <dt><untranslated>/getlist &lt;user&gt;</untranslated></dt>
   <dd>Adds the user's list to the Download Queue.</dd>
+  <dt><untranslated>/ignore &lt;user&gt;</untranslated></dt>
+  <dd>Adds a user matching definition (or modifies an existing one, if possible) to ignore chat
+  messages from the specified user.</dd>
+  <dt><untranslated>/unignore &lt;user&gt;</untranslated></dt>
+  <dd>Adds a user matching definition (or modifies an existing one, if possible) to stop ignoring
+  chat messages from the specified user.</dd>
 </dl>
 <h2>Private Message</h2>
 <dl style="margin-left: 40px;">
@@ -48,7 +54,13 @@
   <dt><untranslated>/favorite</untranslated></dt>
   <dt><untranslated>/fav</untranslated></dt>
   <dd>Adds the current user to the list of <a
- href="favorite_users.html">Favorite Users</a>.</dd>
+	  href="favorite_users.html">Favorite Users</a>.</dd>
+  <dt><untranslated>/ignore</dt>
+  <dd>Adds a user matching definition (or modifies an existing one, if possible) to ignore chat
+  messages from the current user.</dd>
+  <dt><untranslated>/unignore</dt>
+  <dd>Adds a user matching definition (or modifies an existing one, if possible) to stop ignoring
+  chat messages from the current user.</dd>
 </dl>
 <h2>Both</h2>
 <dl style="margin-left: 40px;">

=== modified file 'help/commands_user_general.inc'
--- help/commands_user_general.inc	2009-03-22 17:24:47 +0000
+++ help/commands_user_general.inc	2011-12-11 14:45:53 +0000
@@ -9,12 +9,19 @@
 	users. 2 files are considered to be the same if their TTH is the same. If matches are found in one user's file list,
 	she will be added as a source for the relevant downloads.</dd>
 	<dt>Send private message</dt>
-	<dd>Open <a href="window_pm.html">private message</a> windows to chat privately with the selected users.</dd>
+	<dd>Open <placeholder><a href="window_pm.html">Private Message</a></placeholder> windows to
+	chat privately with the selected users.</dd>
 	<dt>Grant extra slot</dt>
-	<dd>Beyond your set slots an extra upload slot will be given to the selected users until the
-	end of the current DC++ session.</dd>
+	<dd>In addition to your regular upload slots, an extra upload slot will be given to the
+	selected users until the end of the current DC++ session.</dd>
 	<dt>Remove user from queue</dt>
-	<dd>Removes the selected user from the source list of all queued files. Pending filelist requests
-	will be removed as well.</dd>
+	<dd>Remove the selected users from the source list of all queued files. Pending file list
+	requests will be removed as well.</dd>
+	<dt>Ignore chat</dt>
+	<dd>Add user matching definitions (or modify existing ones, if possible) to ignore chat
+	messages from the selected users.</dd>
+	<dt>Un-ignore chat</dt>
+	<dd>Add user matching definitions (or modify existing ones, if possible) to stop ignoring chat
+	messages from the selected users.</dd>
 </dl>
 

=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp	2011-12-10 18:51:47 +0000
+++ win32/HubFrame.cpp	2011-12-11 14:45:53 +0000
@@ -419,13 +419,27 @@
 			addAsFavorite();
 		} else if((Util::stricmp(cmd.c_str(), _T("removefavorite")) == 0) || (Util::stricmp(cmd.c_str(), _T("removefav")) == 0)) {
 			removeFavoriteHub();
-		} else if(Util::stricmp(cmd.c_str(), _T("getlist")) == 0){
-			if( !param.empty() ){
-				UserInfo* ui = findUser(param);
+		} else if(Util::stricmp(cmd.c_str(), _T("getlist")) == 0) {
+			if(!param.empty()) {
+				auto ui = findUser(param);
 				if(ui) {
 					ui->getList();
 				}
 			}
+		} else if(Util::stricmp(cmd.c_str(), _T("ignore")) == 0) {
+			if(!param.empty()) {
+				auto ui = findUser(param);
+				if(ui) {
+					ui->ignoreChat(true);
+				}
+			}
+		} else if(Util::stricmp(cmd.c_str(), _T("unignore")) == 0) {
+			if(!param.empty()) {
+				auto ui = findUser(param);
+				if(ui) {
+					ui->ignoreChat(false);
+				}
+			}
 		} else if(Util::stricmp(cmd.c_str(), _T("log")) == 0) {
 			if(param.empty())
 				openLog();
@@ -433,8 +447,10 @@
 				openLog(true);
 		} else if(Util::stricmp(cmd.c_str(), _T("help")) == 0) {
 			addChat(_T("*** ") + WinUtil::commands +
-				_T(", /join <hub-ip>, /showjoins, /favshowjoins, /close, /userlist, /conn[ection], /fav[orite], ")
-				_T("/pm <user> [message], /getlist <user>, /log <status, system, downloads, uploads>, /removefav[orite]"));
+				_T(", /join <hub-ip>, /showjoins, /favshowjoins, /close, /userlist, ")
+				_T("/conn[ection], /fav[orite], /removefav[orite], ")
+				_T("/pm <user> [message], /getlist <user>, /ignore <user>, /unignore <user>, ")
+				_T("/log <status, system, downloads, uploads>"));
 		} else if(Util::stricmp(cmd.c_str(), _T("pm")) == 0) {
 			string::size_type j = param.find(_T(' '));
 			if(j != string::npos) {

=== modified file 'win32/PrivateFrame.cpp'
--- win32/PrivateFrame.cpp	2011-12-05 22:02:01 +0000
+++ win32/PrivateFrame.cpp	2011-12-11 14:45:53 +0000
@@ -303,10 +303,14 @@
 			addStatus(T_("Favorite user added"));
 		} else if(Util::stricmp(cmd.c_str(), _T("getlist")) == 0) {
 			handleGetList();
+		} else if(Util::stricmp(cmd.c_str(), _T("ignore")) == 0) {
+			handleIgnoreChat(true);
+		} else if(Util::stricmp(cmd.c_str(), _T("unignore")) == 0) {
+			handleIgnoreChat(false);
 		} else if(Util::stricmp(cmd.c_str(), _T("log")) == 0) {
 			openLog();
 		} else if(Util::stricmp(cmd.c_str(), _T("help")) == 0) {
-			addStatus(_T("*** ") + WinUtil::commands + _T(", /getlist, /grant, /close, /favorite, /log <system, downloads, uploads>"));
+			addStatus(_T("*** ") + WinUtil::commands + _T(", /getlist, /grant, /close, /favorite, /ignore, /unignore, /log <system, downloads, uploads>"));
 		} else {
 			send = true;
 		}