# HG changeset patch # User Christian Hammond # Date 1060372185 0 # Node ID e3be6b9744b701aa11aafcbca0366bd033f86ea1 # Parent 874a5c9f4eb8e942da374fea2f053f79bf1216bf [gaim-migrate @ 6922] Committing a patch from Paco-Paco. Adds the /help command to IRC and updates the todo. committer: Tailor Script diff -r 874a5c9f4eb8 -r e3be6b9744b7 src/protocols/irc/.todo --- 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 @@ - + IRC + + ison + /remove @@ -29,9 +32,6 @@ Allow text to be sent on /query - - ison - remember /ignore list in privacy section @@ -47,7 +47,7 @@ /list - + error message on unknown commands (don't just pass to ircd) diff -r 874a5c9f4eb8 -r e3be6b9744b7 src/protocols/irc/cmds.c --- 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), "", _("Supported IRC Commands:
" + "AWAY INVITE JOIN KICK
" + "ME MODE MSG NAMES
" + "NICK OP DEOP OPERWALL
" + "PART PING QUERY QUIT
" + "QUOTE REMOVE TOPIC UMODE
" + "VOICE DEVOICE WALLOPS WHOIS
"), + WFLAG_NOLOG, time(NULL)); + } else { + gaim_im_write(GAIM_IM(convo), "", _("Supported IRC Commands:
" + "AWAY JOIN ME MODE
" + "MSG NICK OPERWALL PING
" + "QUERY QUIT QUOTE UMODE
" + "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; diff -r 874a5c9f4eb8 -r e3be6b9744b7 src/protocols/irc/irc.h --- 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); diff -r 874a5c9f4eb8 -r e3be6b9744b7 src/protocols/irc/parse.c --- 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 },