]> jfr.im git - irc/quakenet/newserv.git/blobdiff - chanserv/chancmds/op.c
fix bug in G stats
[irc/quakenet/newserv.git] / chanserv / chancmds / op.c
index 365f948f7ef152b89225329e4a78fcefcd3e7108..b4a9cc37e7f61c0d63f33c95bc7744947d6a4f7b 100644 (file)
@@ -7,7 +7,7 @@
  * CMDDESC: Ops you or other users on channel(s).
  * CMDFUNC: csc_doop
  * CMDPROTO: int csc_doop(void *source, int cargc, char **cargv);
  * CMDDESC: Ops you or other users on channel(s).
  * CMDFUNC: csc_doop
  * CMDPROTO: int csc_doop(void *source, int cargc, char **cargv);
- * CMDHELP: Usage: OP [<channel> [<user1> [<user2> [...]]]
+ * CMDHELP: Usage: OP [<channel> [<user1> [<user2> [...]]]]
  * CMDHELP: Ops you on one or more channels, or ops other named users on a given channel.
  * CMDHELP: This command cannot be used to op users who are otherwise prevented from getting
  * CMDHELP: ops, e.g. via the +d chanlev flag (see CHANLEV) or bitch mode (see CHANFLAGS).
  * CMDHELP: Ops you on one or more channels, or ops other named users on a given channel.
  * CMDHELP: This command cannot be used to op users who are otherwise prevented from getting
  * CMDHELP: ops, e.g. via the +d chanlev flag (see CHANLEV) or bitch mode (see CHANFLAGS).
@@ -81,6 +81,12 @@ int csc_doop(void *source, int cargc, char **cargv) {
     return CMD_ERROR;
 
   rcp=cip->exts[chanservext];
     return CMD_ERROR;
 
   rcp=cip->exts[chanservext];
+  
+  /* If the channel doesn't currently exist, forget it. */
+  if (!cip->channel) { 
+    chanservstdmessage(sender, QM_EMPTYCHAN, cip->name->content);  
+    return CMD_ERROR;
+  }
 
   if (cargc==1) {
     /* Only one arg: "op me" */
 
   if (cargc==1) {
     /* Only one arg: "op me" */
@@ -137,7 +143,7 @@ int csc_doop(void *source, int cargc, char **cargv) {
   }
 
   if (donotice && bufpos) {
   }
 
   if (donotice && bufpos) {
-    sendopnoticetochannel(chanservnick, cip->channel, "%s opped %s", sender, buf);
+    sendopnoticetochannel(chanservnick, cip->channel, "%s opped %s", sender->nick, buf);
   }
       
   localsetmodeflush(&changes, 1);
   }
       
   localsetmodeflush(&changes, 1);