changeset 755:b747f76e57ae

Add "/event n ignore"
author Mikael Berthe <mikael@lilotux.net>
date Tue, 14 Mar 2006 12:08:57 +0100
parents 5b962b978573
children 12dc6bdff8c1
files mcabber/src/commands.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/commands.c	Tue Mar 14 12:04:46 2006 +0100
+++ b/mcabber/src/commands.c	Tue Mar 14 12:08:57 2006 +0100
@@ -196,6 +196,7 @@
 
   // Events category
   compl_add_category_word(COMPL_EVENTS, "accept");
+  compl_add_category_word(COMPL_EVENTS, "ignore");
   compl_add_category_word(COMPL_EVENTS, "reject");
 }
 
@@ -1974,11 +1975,18 @@
     action = 0;
   else if (!strcasecmp(subcmd, "accept"))
     action = 1;
+  else if (!strcasecmp(subcmd, "ignore"))
+    action = 2;
 
   if (action == -1) {
     scr_LogPrint(LPRINT_NORMAL, "Wrong action parameter.");
-  } else if (action == 0 || action == 1) {
-    if (evs_callback(evid, EVS_CONTEXT_USER + action) == -1) {
+  } else if (action >= 0 && action <= 2) {
+    if (action == 2) {
+      action = EVS_CONTEXT_CANCEL;
+    } else {
+      action += EVS_CONTEXT_USER;
+    }
+    if (evs_callback(evid, action) == -1) {
       scr_LogPrint(LPRINT_NORMAL, "Event %s not found.", evid);
     }
   }