changeset 9442:1e6bba55447c

[gaim-migrate @ 10263] If we have commands in core, might as well not waste memory with this stuff committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Fri, 02 Jul 2004 18:45:24 +0000
parents eaa9aa1fad61
children 3584cdab1d0b
files src/protocols/irc/irc.c src/protocols/irc/irc.h src/protocols/irc/parse.c
diffstat 3 files changed, 1 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Fri Jul 02 04:16:04 2004 +0000
+++ b/src/protocols/irc/irc.c	Fri Jul 02 18:45:24 2004 +0000
@@ -327,11 +327,7 @@
 	else
 		args[0] = who;
 	args[1] = what;
-#if 0
-	if (*what == '/') {
-		return irc_parse_cmd(irc, who, what + 1);
-	}
-#endif
+
 	irc_cmd_privmsg(irc, "msg", NULL, args);
 	return 1;
 }
--- a/src/protocols/irc/irc.h	Fri Jul 02 04:16:04 2004 +0000
+++ b/src/protocols/irc/irc.h	Fri Jul 02 18:45:24 2004 +0000
@@ -90,7 +90,6 @@
 void irc_register_commands(void);
 void irc_msg_table_build(struct irc_conn *irc);
 void irc_parse_msg(struct irc_conn *irc, char *input);
-int irc_parse_cmd(struct irc_conn *irc, const char *target, const char *cmdstr);
 char *irc_parse_ctcp(struct irc_conn *irc, const char *from, const char *to, const char *msg, int notice);
 char *irc_format(struct irc_conn *irc, const char *format, ...);
 
--- a/src/protocols/irc/parse.c	Fri Jul 02 04:16:04 2004 +0000
+++ b/src/protocols/irc/parse.c	Fri Jul 02 18:45:24 2004 +0000
@@ -550,63 +550,6 @@
 	g_free(from);
 }
 
-int irc_parse_cmd(struct irc_conn *irc, const char *target, const char *cmdstr)
-{
-	const char *cur, *end, *fmt; 
-	char *tmp, *cmd, **args;
-	struct _irc_user_cmd *cmdent;
-	guint i;
-	int ret;
-
-	cur = cmdstr;
-	end = strchr(cmdstr, ' ');
-	if (!end)
-		end = cur + strlen(cur);
-
-	tmp = g_strndup(cur, end - cur);
-	cmd = g_utf8_strdown(tmp, -1);
-	g_free(tmp);
-
-	if ((cmdent = g_hash_table_lookup(irc->cmds, cmd)) == NULL) {
-		ret = irc_cmd_default(irc, cmd, target, &cmdstr);
-		g_free(cmd);
-		return ret;
-	}
-
-	args = g_new0(char *, strlen(cmdent->format));
-	for (cur = end, fmt = cmdent->format, i = 0; fmt[i] && *cur++; i++) {
-		switch (fmt[i]) {
-		case 'v':
-			if (!(end = strchr(cur, ' '))) end = cur + strlen(cur);
-			args[i] = g_strndup(cur, end - cur);
-			cur += end - cur;
-			break;
-		case 't':
-		case 'n':
-		case 'c':
-			if (!(end = strchr(cur, ' '))) end = cur + strlen(cur);
-			args[i] = g_strndup(cur, end - cur);
-			cur += end - cur;
-			break;
-		case ':':
-		case '*':
-			args[i] = g_strdup(cur);
-			cur = cur + strlen(cur);
-			break;
-		default:
-			gaim_debug(GAIM_DEBUG_ERROR, "irc", "invalid command format character '%c'\n", fmt[i]);
-			break;
-		}
-	}
-	ret = (cmdent->cb)(irc, cmd, target, (const char **)args);
-	for (i = 0; i < strlen(cmdent->format); i++)
-		g_free(args[i]);
-	g_free(args);
-
-	g_free(cmd);
-	return ret;
-}
-
 static void irc_parse_error_cb(struct irc_conn *irc, char *input)
 {
 	gaim_debug(GAIM_DEBUG_WARNING, "irc", "Unrecognized string: %s\n", input);