Просмотр исходного кода

Merge branch 'auth-mop' into next

* auth-mop:
  * Update cmd_mop to use console channel

Conflicts:
	doc/UPDATES
Bryan Drewery 15 лет назад
Родитель
Сommit
8e7afab9c6
2 измененных файлов с 7 добавлено и 14 удалено
  1. 1 0
      doc/UPDATES
  2. 6 14
      src/mod/irc.mod/cmdsirc.c

+ 1 - 0
doc/UPDATES

@@ -4,6 +4,7 @@ next
   * When 'mop' protection is on, deop all previously regular clients automatically.
   * Properly honor exemptions when kicking matched RBL clients
   * Auto FiSH key-exchange when accepting users via callerid
+  * Update cmd_mop to support console channel (so it works via Auth commands better)
 
 1.4.0 - http://wraith.botpack.net/milestone/1.4.0
   * Add an extra 2 second delay before releasing nick to aide in syncing and time to type /nick

+ 6 - 14
src/mod/irc.mod/cmdsirc.c

@@ -1183,32 +1183,24 @@ static void cmd_getkey(int idx, char *par)
 
 static void cmd_mop(int idx, char *par)
 {
-  struct chanset_t *chan = NULL;
   bool found = 0, all = 0;
-  char *chname = NULL;
+  char *chname = newsplit(&par);
+
+  struct chanset_t* chan = get_channel(idx, chname, 1, &all);
 
-  if (par[0] == '*' && !par[1]) {
+  if (all) {
     get_user_flagrec(dcc[idx].user, &user, NULL);
     if (!glob_owner(user)) {
       dprintf(idx, "You do not have access to mop '*'\n");
       return;
     }
-    all = 1;
     chan = chanset;
-    newsplit(&par);
-  } else {
-    if (par[0] && (strchr(CHANMETA, par[0]) != NULL)) {
-      chname = newsplit(&par);
-      chan = get_channel(idx, chname, 0);
-    } else
-      chan = get_channel(idx, "", 0);
   }
 
-  if (!chan && !all && !chname) {
+  if (!chan && !all) {
     dprintf(idx, "Usage: mop <channel|*>\n");
     return;
-  } else if (!chan)
-    return;
+  }
 
   putlog(LOG_CMDS, "*", "#%s# (%s) mop %s", dcc[idx].nick, all ? "*" : chan->dname, par);