comparison libpurple/protocols/irc/irc.c @ 22958:f1dfc0d70d19

Fix irc nick collision handling, as requested by that demanding user elb. Now we append the extra digit, unless the server responds with a shorter nick than we requested, in which case we just change the last digit as before.
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 15 May 2008 15:22:04 +0000
parents 252b96b6a32c
children 25161f5ea347 928f24e09279
comparison
equal deleted inserted replaced
22957:a84b748c4c1e 22958:f1dfc0d70d19
402 if (irc_send(irc, buf) < 0) { 402 if (irc_send(irc, buf) < 0) {
403 g_free(buf); 403 g_free(buf);
404 return FALSE; 404 return FALSE;
405 } 405 }
406 g_free(buf); 406 g_free(buf);
407 buf = irc_format(irc, "vn", "NICK", purple_connection_get_display_name(gc)); 407 username = purple_connection_get_display_name(gc);
408 buf = irc_format(irc, "vn", "NICK", username);
409 irc->reqnick = g_strdup(username);
410 irc->nickused = FALSE;
408 if (irc_send(irc, buf) < 0) { 411 if (irc_send(irc, buf) < 0) {
409 g_free(buf); 412 g_free(buf);
410 return FALSE; 413 return FALSE;
411 } 414 }
412 g_free(buf); 415 g_free(buf);
489 purple_input_remove(irc->writeh); 492 purple_input_remove(irc->writeh);
490 493
491 purple_circ_buffer_destroy(irc->outbuf); 494 purple_circ_buffer_destroy(irc->outbuf);
492 495
493 g_free(irc->mode_chars); 496 g_free(irc->mode_chars);
497 g_free(irc->reqnick);
494 498
495 g_free(irc); 499 g_free(irc);
496 } 500 }
497 501
498 static int irc_im_send(PurpleConnection *gc, const char *who, const char *what, PurpleMessageFlags flags) 502 static int irc_im_send(PurpleConnection *gc, const char *who, const char *what, PurpleMessageFlags flags)