changeset 6415:e3be6b9744b7

[gaim-migrate @ 6922] Committing a patch from Paco-Paco. Adds the /help command to IRC and updates the todo. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 08 Aug 2003 19:49:45 +0000
parents 874a5c9f4eb8
children f646b60e2960
files src/protocols/irc/.todo src/protocols/irc/cmds.c src/protocols/irc/irc.h src/protocols/irc/parse.c
diffstat 4 files changed, 36 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/.todo	Fri Aug 08 19:48:50 2003 +0000
+++ b/src/protocols/irc/.todo	Fri Aug 08 19:49:45 2003 +0000
@@ -1,7 +1,10 @@
-<!-- Automagically generated by the ToDo program on Mon Aug  4 11:40:17 2003 -->
+<!-- Automagically generated by the ToDo program on Tue Aug  5 12:16:30 2003 -->
 <todo version="0.1.17">
     <note priority="medium" time="1036040668">
         IRC
+        <note priority="veryhigh" time="1058905390" done="1060103775">
+            ison
+        </note>
         <note priority="high" time="1036041722" done="1058917560">
             /remove
         </note>
@@ -29,9 +32,6 @@
         <note priority="medium" time="1058755195" done="1058918104">
             Allow text to be sent on /query
         </note>
-        <note priority="veryhigh" time="1058905390">
-            ison
-        </note>
         <note priority="high" time="1037675268">
             remember /ignore list in privacy section
         </note>
@@ -47,7 +47,7 @@
         <note priority="medium" time="1059193670">
             /list
         </note>
-        <note priority="medium" time="1059198036">
+        <note priority="medium" time="1059198036" done="1060103790">
             error message on unknown commands (don't just pass to ircd)
         </note>
         <note priority="medium" time="1059264210">
--- a/src/protocols/irc/cmds.c	Fri Aug 08 19:48:50 2003 +0000
+++ b/src/protocols/irc/cmds.c	Fri Aug 08 19:49:45 2003 +0000
@@ -122,6 +122,35 @@
 	return 1;
 }
 
+int irc_cmd_help(struct irc_conn *irc, const char *cmd, const char *target, const char **args)
+{
+	GaimConversation *convo = gaim_find_conversation_with_account(target, irc->account);
+
+	/* XXX we should eventually have per-command help */
+
+	if (!convo)
+		return 0;
+
+	if (gaim_conversation_get_type(convo) == GAIM_CONV_CHAT) {
+		gaim_chat_write(GAIM_CHAT(convo), "", _("<B>Supported IRC Commands:</B><BR>"
+							"AWAY INVITE JOIN KICK<BR>"
+							"ME MODE MSG NAMES<BR>"
+							"NICK OP DEOP OPERWALL<BR>"
+							"PART PING QUERY QUIT<BR>"
+							"QUOTE REMOVE TOPIC UMODE<BR>"
+							"VOICE DEVOICE WALLOPS WHOIS<BR>"),
+				WFLAG_NOLOG, time(NULL));
+	} else {
+		gaim_im_write(GAIM_IM(convo), "", _("<B>Supported IRC Commands:</B><BR>"
+						    "AWAY JOIN ME MODE<BR>"
+						    "MSG NICK OPERWALL PING<BR>"
+						    "QUERY QUIT QUOTE UMODE<BR>"
+						    "WALLOPS WHOIS"), -1, WFLAG_NOLOG, time(NULL));
+	}
+
+	return 0;
+}
+
 int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args)
 {
 	char *buf;
--- a/src/protocols/irc/irc.h	Fri Aug 08 19:48:50 2003 +0000
+++ b/src/protocols/irc/irc.h	Fri Aug 08 19:49:45 2003 +0000
@@ -127,6 +127,7 @@
 int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_away(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_ctcp_action(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
+int irc_cmd_help(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_join(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_kick(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
--- a/src/protocols/irc/parse.c	Fri Aug 08 19:48:50 2003 +0000
+++ b/src/protocols/irc/parse.c	Fri Aug 08 19:49:45 2003 +0000
@@ -102,6 +102,7 @@
 	{ "away", ":", irc_cmd_away },
 	{ "deop", ":", irc_cmd_op },
 	{ "devoice", ":", irc_cmd_op },
+	{ "help", "v", irc_cmd_help },
 	{ "invite", ":", irc_cmd_invite },
 	{ "j", "cv", irc_cmd_join },
 	{ "join", "cv", irc_cmd_join },