diff src/protocols/irc/cmds.c @ 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 05b488eda686
children 42fdf16f1dad
line wrap: on
line diff
--- 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;