# HG changeset patch # User Rob Flynn # Date 986022415 0 # Node ID 3232467ae220cf74e289650531fe38439e360083 # Parent 1127fa1b4c02808906ff4a7b1b97d8f71b0e899b [gaim-migrate @ 1685] I didnt test it, but I think it works. committer: Tailor Script diff -r 1127fa1b4c02 -r 3232467ae220 plugins/irc.c --- a/plugins/irc.c Sat Mar 31 06:50:58 2001 +0000 +++ b/plugins/irc.c Sat Mar 31 07:06:55 2001 +0000 @@ -70,6 +70,8 @@ return "IRC"; } +static void irc_get_info(struct gaim_connection *gc, char *who); + char *name() { return "IRC"; @@ -185,6 +187,15 @@ g_snprintf(buf, IRC_BUF_LEN, "PRIVMSG %s :%cACTION %s%c\n", who, '\001', temp, '\001'); g_free(temp); } + else if (!g_strncasecmp(message, "/whois ", 7) && (strlen(message) > 7)) { + gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); + strcpy(temp, message + 7); + irc_get_info(gc, temp); + g_free(temp); + + return; + } + } else { g_snprintf(buf, IRC_BUF_LEN, "PRIVMSG %s :%s\n", who, message); @@ -293,17 +304,30 @@ /* Before we actually send this, we should check to see if they're trying - * To issue a /me command and handle it properly. */ + * To issue a command and handle it properly. */ - if ((g_strncasecmp(message, "/me ", 4) == 0) && (strlen(message) > 4)) { - /* We have /me!! We have /me!! :-) */ + if (message[0] == '/') + { + if ((g_strncasecmp(message, "/me ", 4) == 0) && (strlen(message) > 4)) { + /* We have /me!! We have /me!! :-) */ - gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); - strcpy(temp, message + 4); - g_snprintf(buf, IRC_BUF_LEN, "PRIVMSG #%s :%cACTION %s%c\n", channel->name, '\001', temp, - '\001'); - g_free(temp); - } else { + gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); + strcpy(temp, message + 4); + g_snprintf(buf, IRC_BUF_LEN, "PRIVMSG #%s :%cACTION %s%c\n", channel->name, '\001', temp, + '\001'); + g_free(temp); + } + else if (!g_strncasecmp(message, "/whois ", 7) && (strlen(message) > 7)) { + gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); + + strcpy(temp, message + 7); + irc_get_info(gc, temp); + g_free(temp); + + return; + } + } + else { g_snprintf(buf, IRC_BUF_LEN, "PRIVMSG #%s :%s\n", channel->name, message); }