comparison src/protocols/irc/irc.c @ 3511:7e1c6c16dd41

[gaim-migrate @ 3583] a notify.so fix from deryni. Also, I added some code so that when IRC tells you your nick is already in use, it will ask you to enter a new one rather than just wait to get kicked off. Of course, I didn't test it all, and because I suck, it doesn't work. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 15 Sep 2002 03:40:48 +0000
parents 3335ef5fbecc
children f4cec5d41a89
comparison
equal deleted inserted replaced
3510:e23909729192 3511:7e1c6c16dd41
811 } 811 }
812 812
813 id->liststr = g_string_append(id->liststr, word_eol[4]); 813 id->liststr = g_string_append(id->liststr, word_eol[4]);
814 } 814 }
815 815
816 static void irc_change_nick(void *a, char *b) {
817 struct gaim_connection *gc = a;
818 struct irc_data *id = gc->proto_data;
819 char buf[IRC_BUF_LEN];
820 g_snprintf(buf, sizeof(buf), "NICK %s\r\n", b);
821 irc_write(id->fd, buf, strlen(buf));
822 }
823
816 static void process_numeric(struct gaim_connection *gc, char *word[], char *word_eol[]) 824 static void process_numeric(struct gaim_connection *gc, char *word[], char *word_eol[])
817 { 825 {
818 struct irc_data *id = gc->proto_data; 826 struct irc_data *id = gc->proto_data;
819 char *text = word_eol[3]; 827 char *text = word_eol[3];
820 int n = atoi(word[2]); 828 int n = atoi(word[2]);
896 case 402: 904 case 402:
897 do_error_dialog(_("There is no such IRC Server"), NULL, GAIM_ERROR); 905 do_error_dialog(_("There is no such IRC Server"), NULL, GAIM_ERROR);
898 case 431: 906 case 431:
899 do_error_dialog(_("No IRC nickname given"), NULL, GAIM_ERROR); 907 do_error_dialog(_("No IRC nickname given"), NULL, GAIM_ERROR);
900 break; 908 break;
909 case 433:
910 do_prompt_dialog(_("That nick is already in use. Please enter a new nick"), gc->displayname, gc, irc_change_nick, NULL);
901 default: 911 default:
902 if (n > 400 && n < 502) { 912 if (n > 400 && n < 502) {
903 char errmsg[IRC_BUF_LEN]; 913 char errmsg[IRC_BUF_LEN];
904 char *errmsg1 = strrchr(text, ':'); 914 char *errmsg1 = strrchr(text, ':');
905 g_snprintf(errmsg, sizeof(errmsg), "IRC Error %d", n); 915 g_snprintf(errmsg, sizeof(errmsg), "IRC Error %d", n);