]> jfr.im git - irc/quakenet/newserv.git/blobdiff - chanserv/usercmds/info.c
TRUSTS: require sqlite
[irc/quakenet/newserv.git] / chanserv / usercmds / info.c
index ba480596701c39dbb6d407bc3d7c415b3fdc9d25..ca959f6198bf0b27335d5f6fe18a2f34f0763696 100644 (file)
@@ -2,11 +2,19 @@
  *
  *
  * CMDNAME: info
- * CMDLEVEL: QCMD_AUTHED
+ * CMDLEVEL: QCMD_AUTHED | QCMD_OPER
  * CMDARGS: 2
  * CMDDESC: Shows or changes info line.
  * CMDFUNC: csu_doinfo
  * CMDPROTO: int csu_doinfo(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: INFO [<channel>] [<info line>]
+ * CMDHELP: Shows or updates your current info line, which can be configured to be displayed
+ * CMDHELP: when you join a channel.  Where:
+ * CMDHELP: channel   - channel to set info line on.  If no channel is specified, your default
+ * CMDHELP:             info line will be used.  If a channel is specified you must be known
+ * CMDHELP:             (+k) on the channel.
+ * CMDHELP: info line - new info line to set.  If not specified, the current info line will be
+ * CMDHELP:             displayed.  If \"none\" is specified, the info line will be cleared.
  */
 
 #include "../chanserv.h"
@@ -52,7 +60,7 @@ int csu_doinfo(void *source, int cargc, char **cargv) {
       csdb_updateuser(rup);
     }
     
-    chanservstdmessage(sender, QM_GLOBALINFO, rup->info?rup->info->content:"(none)");
+    chanservstdmessage(sender, QM_GLOBALINFO, (rup->info && *rup->info->content)?rup->info->content:"(none)");
   } else {
     /* Channel info line */
 
@@ -81,7 +89,7 @@ int csu_doinfo(void *source, int cargc, char **cargv) {
     }
 
     chanservstdmessage(sender, QM_CHANNELINFO, cip->name->content, 
-                      rcup->info?rcup->info->content:"(none)");
+                      (rcup->info && *rcup->info->content)?rcup->info->content:"(none)");
   }
 
   return CMD_OK;