comparison src/protocols/irc/irc.c @ 4065:1590dfa0ecba

[gaim-migrate @ 4275] (01:38:36) LSchiere: go fix some bug. give me something to be optimistic about (01:55:20) LSchiere: oh. i have a better bug for you to fix. fix the /kick bug (01:55:33) LSchiere: so that when you /kick someone in #gaim they don't appear to have been kicked in [other channels] I think this will fix that--it might just make things worse. Yay, beer! committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 12 Dec 2002 07:13:05 +0000
parents 9ced82507a79
children bb4aabb9ba53
comparison
equal deleted inserted replaced
4064:b188b93ebf48 4065:1590dfa0ecba
1123 return TRUE; 1123 return TRUE;
1124 return FALSE; 1124 return FALSE;
1125 } 1125 }
1126 1126
1127 static void 1127 static void
1128 irc_rem_chat_bud(struct gaim_connection *gc, char *nick, char *reason) 1128 irc_rem_chat_bud(struct gaim_connection *gc, char *nick, struct conversation *b, char *reason)
1129 { 1129 {
1130 GSList *bcs = gc->buddy_chats; 1130
1131 1131 GList *r = b->in_room;
1132 while (bcs) { 1132 while (r) {
1133 struct conversation *b = bcs->data; 1133 char *who = r->data;
1134 1134 if (*who == '@')
1135 GList *r = b->in_room; 1135 who++;
1136 while (r) { 1136 if (*who == '+')
1137 char *who = r->data; 1137 who++;
1138 if (*who == '@') 1138 if (!g_strcasecmp(who, nick)) {
1139 who++; 1139 char *tmp = g_strdup(r->data);
1140 if (*who == '+') 1140 remove_chat_buddy(b, tmp, reason);
1141 who++; 1141 g_free(tmp);
1142 if (!g_strcasecmp(who, nick)) { 1142 break;
1143 char *tmp = g_strdup(r->data); 1143 }
1144 remove_chat_buddy(b, tmp, reason);
1145 g_free(tmp);
1146 break;
1147 }
1148 r = r->next; 1144 r = r->next;
1149 }
1150 bcs = bcs->next;
1151 } 1145 }
1152 } 1146 }
1153 1147
1154 static void 1148 static void
1155 irc_change_name(struct gaim_connection *gc, char *old, char *new) 1149 irc_change_name(struct gaim_connection *gc, char *old, char *new)
1393 word[3], *word_eol[5] == ':' ? word_eol[5] + 1 : word_eol[5]); 1387 word[3], *word_eol[5] == ':' ? word_eol[5] + 1 : word_eol[5]);
1394 do_error_dialog(outbuf, _("IRC Error"), GAIM_ERROR); 1388 do_error_dialog(outbuf, _("IRC Error"), GAIM_ERROR);
1395 } else { 1389 } else {
1396 char *reason = *word_eol[5] == ':' ? word_eol[5] + 1 : word_eol[5]; 1390 char *reason = *word_eol[5] == ':' ? word_eol[5] + 1 : word_eol[5];
1397 char *msg = g_strdup_printf(_("Kicked by %s: %s"), nick, reason); 1391 char *msg = g_strdup_printf(_("Kicked by %s: %s"), nick, reason);
1398 irc_rem_chat_bud(gc, word[4], msg); 1392 struct conversation *c = irc_find_chat(gc, word[3]);
1393 irc_rem_chat_bud(gc, word[4], c, msg);
1399 g_free(msg); 1394 g_free(msg);
1400 } 1395 }
1401 } else if (!strcmp(cmd, "KILL")) { /* */ 1396 } else if (!strcmp(cmd, "KILL")) { /* */
1402 } else if (!strcmp(cmd, "MODE")) { 1397 } else if (!strcmp(cmd, "MODE")) {
1403 handle_mode(gc, word, word_eol, FALSE); 1398 handle_mode(gc, word, word_eol, FALSE);
1424 } else { 1419 } else {
1425 handle_privmsg(gc, to, nick, msg); 1420 handle_privmsg(gc, to, nick, msg);
1426 } 1421 }
1427 } else if (!strcmp(cmd, "PONG")) { /* */ 1422 } else if (!strcmp(cmd, "PONG")) { /* */
1428 } else if (!strcmp(cmd, "QUIT")) { 1423 } else if (!strcmp(cmd, "QUIT")) {
1429 irc_rem_chat_bud(gc, nick, *word_eol[3] == ':' ? word_eol[3] + 1 : word_eol[3]); 1424 irc_rem_chat_bud(gc, nick, irc_find_chat(gc, word[3]), *word_eol[3] == ':' ? word_eol[3] + 1 : word_eol[3]);
1430 } else if (!strcmp(cmd, "TOPIC")) { 1425 } else if (!strcmp(cmd, "TOPIC")) {
1431 irc_parse_topic(gc, nick, word, word_eol); 1426 irc_parse_topic(gc, nick, word, word_eol);
1432 } else if (!strcmp(cmd, "WALLOPS")) { /* Don't know if a dialog box is the right way? */ 1427 } else if (!strcmp(cmd, "WALLOPS")) { /* Don't know if a dialog box is the right way? */
1433 char *msg = strrchr(word_eol[0], ':'); 1428 char *msg = strrchr(word_eol[0], ':');
1434 if (msg) 1429 if (msg)