# HG changeset patch # User Eric Warmenhoven # Date 1007547318 0 # Node ID e49bd1479eddfce2dc4f6b161b7f49428f0248db # Parent 4b3f17ca66bf889e04d52e509fedd6d431a85f6d [gaim-migrate @ 2860] apathy by seanegan. i mean. apache by seanegan. i'm so lame. a patch by seanegan. committer: Tailor Script diff -r 4b3f17ca66bf -r e49bd1479edd src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Wed Dec 05 09:48:56 2001 +0000 +++ b/src/protocols/irc/irc.c Wed Dec 05 10:15:18 2001 +0000 @@ -866,7 +866,9 @@ nick[ex - pdibuf] = 0; /* cut the buffer at the '!' */ } - if (!strcmp(cmd, "INVITE")) { /* */ + if (!strcmp(cmd, "INVITE")) { + char *chan = g_strdup(word[4]); + serv_got_chat_invite(gc, chan + 1, nick, NULL, g_list_append(NULL, chan)); } else if (!strcmp(cmd, "JOIN")) { char *chan = *word[3] == ':' ? word[3] + 1 : word[3]; if (!g_strcasecmp(gc->displayname, nick)) { @@ -1282,6 +1284,10 @@ g_snprintf(buf, sizeof(buf), "PRIVMSG %s :\001ACTION %s\001\r\n", who, word_eol[2]); irc_write(id->fd, buf, strlen(buf)); return 1; + } else if (!g_strcasecmp(pdibuf, "INVITE")) { + char buf[IRC_BUF_LEN]; + g_snprintf(buf, sizeof(buf), "INVITE %s\r\n", word_eol[2]); + irc_write(id->fd, buf, strlen(buf)); } else if (!g_strcasecmp(pdibuf, "TOPIC")) { if (!*word_eol[2]) return -EINVAL; @@ -1367,9 +1373,10 @@ if (!c) return -EINVAL; write_to_conv(c, "Currently supported commands:
" - "JOIN PART LIST TOPIC WHOIS
" - "OP DEOP VOICE DEVOICE KICK
" - "NICK ME MSG QUOTE SAY
", + "WHOIS INVITE NICK LIST
" + "JOIN PART TOPIC KICK
" + "OP DEOP VOICE DEVOICE
" + "ME MSG QUOTE SAY", WFLAG_NOLOG, NULL, time(NULL)); } else { struct conversation *c = NULL; @@ -1408,6 +1415,14 @@ return handle_command(gc, who, what); } +static void irc_chat_invite(struct gaim_connection *gc, int idn, char *message, char *name) { + char buf[IRC_BUF_LEN]; + struct irc_data *id = gc->proto_data; + struct conversation *c = irc_find_chat_by_id(gc, idn); + g_snprintf(buf, sizeof(buf), "INVITE %s %s\r\n", name, c->name); + irc_write(id->fd, buf, strlen(buf)); +} + static int irc_send_im(struct gaim_connection *gc, char *who, char *what, int flags) { if (*who == '@' || *who == '+') @@ -1550,6 +1565,7 @@ ret->set_away = irc_set_away; ret->get_info = irc_get_info; ret->buddy_menu = irc_buddy_menu; + ret->chat_invite = irc_chat_invite; my_protocol = ret; }