Commit Diff


commit - 28cd2c11914adc102f28eb41be42127f5aab70c0
commit + 2152e377226509a6b3c5f6cd9c8c4a88a9487091
blob - 7cdb4dadef5431796733e312f9a0ad7c88647142
blob + 98ee042e4845cb8917fae58d3dd793b5c92d709b
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc.c,v 1.117 2003/01/13 18:56:30 alex Exp $";
+static char UNUSED id[] = "$Id: irc.c,v 1.118 2003/01/15 13:49:20 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -226,4 +226,25 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
 } /* IRC_TRACE */
 
 
+GLOBAL BOOLEAN
+IRC_HELP( CLIENT *Client, REQUEST *Req )
+{
+	COMMAND *cmd;
+
+	assert( Client != NULL );
+	assert( Req != NULL );
+
+	/* Bad number of arguments? */
+	if( Req->argc > 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
+
+	cmd = Parse_GetCommandStruct( );
+	while( cmd->name )
+	{
+		if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
+		cmd++;
+	}
+	return CONNECTED;
+} /* IRC_HELP */
+
+
 /* -eof- */
blob - 037bcf5890cd7f6c208d5ff121f82dc0b26f3ff7
blob + bca9d029b7fd10acad33d610635de365b770256c
--- src/ngircd/irc.h
+++ src/ngircd/irc.h
@@ -8,7 +8,7 @@
  * (at your option) any later version.
  * Please read the file COPYING, README and AUTHORS for more information.
  *
- * $Id: irc.h,v 1.37 2003/01/13 18:56:30 alex Exp $
+ * $Id: irc.h,v 1.38 2003/01/15 13:49:20 alex Exp $
  *
  * IRC commands (header)
  */
@@ -23,6 +23,7 @@ GLOBAL BOOLEAN IRC_KILL PARAMS(( CLIENT *Client, REQUE
 GLOBAL BOOLEAN IRC_NOTICE PARAMS(( CLIENT *Client, REQUEST *Req ));
 GLOBAL BOOLEAN IRC_PRIVMSG PARAMS(( CLIENT *Client, REQUEST *Req ));
 GLOBAL BOOLEAN IRC_TRACE PARAMS(( CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_HELP PARAMS(( CLIENT *Client, REQUEST *Req ));
 
 
 #endif
blob - 08d47f11494a96c9780d7314b5f800c2143375ff
blob + 1857e726b308fdbcd4416148b3daa80850049098
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: parse.c,v 1.58 2003/01/13 18:56:30 alex Exp $";
+static char UNUSED id[] = "$Id: parse.c,v 1.59 2003/01/15 13:49:20 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -56,6 +56,7 @@ COMMAND My_Commands[] =
 	{ "DIE", IRC_DIE, CLIENT_USER, 0, 0, 0 },
 	{ "DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 0, 0, 0 },
 	{ "ERROR", IRC_ERROR, 0xFFFF, 0, 0, 0 },
+	{ "HELP", IRC_HELP, CLIENT_USER, 0, 0, 0 },
 	{ "INVITE", IRC_INVITE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "ISON", IRC_ISON, CLIENT_USER, 0, 0, 0 },
 	{ "JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },