# HG changeset patch # User Ethan Blanton # Date 1240024092 0 # Node ID fcd7d4c24230d4d44d316771ca21a9e29b21bdc9 # Parent e5ebf3abd9f8876eb2f8fe3c77d0b60740718cda Notify the user if an IRC /nick command fails, rather than trying fallbacks. This code should not come into play on initial connect, but only on /nick commands issued by the user. If it does, we'll have to try again. Fixes #5181 diff -r e5ebf3abd9f8 -r fcd7d4c24230 ChangeLog --- a/ChangeLog Sat Apr 18 02:52:46 2009 +0000 +++ b/ChangeLog Sat Apr 18 03:08:12 2009 +0000 @@ -26,6 +26,9 @@ IRC: * Correctly handle WHOIS for users who are joined to a large number of channels. + * Notify the user if a /nick command fails, rather than trying + fallback nicks. + Pidgin: * Added -f command line option to tell Pidgin to ignore NetworkManager diff -r e5ebf3abd9f8 -r fcd7d4c24230 libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Sat Apr 18 02:52:46 2009 +0000 +++ b/libpurple/protocols/irc/msgs.c Sat Apr 18 03:08:12 2009 +0000 @@ -1004,10 +1004,23 @@ void irc_msg_nickused(struct irc_conn *irc, const char *name, const char *from, char **args) { char *newnick, *buf, *end; + PurpleConnection *gc = purple_account_get_connection(irc->account); if (!args || !args[1]) return; + if (gc && purple_connection_get_state(gc) == PURPLE_CONNECTED) { + /* We only want to do the following dance if the connection + has not been successfully completed. If it has, just + notify the user that their /nick command didn't go. */ + buf = g_strdup_printf(_("The nickname \"%s\" is already being used."), + irc->reqnick); + purple_notify_error(gc, _("Nickname in use"), + _("Nickname in use"), buf); + g_free(buf); + g_free(irc->reqnick); + } + if (strlen(args[1]) < strlen(irc->reqnick) || irc->nickused) newnick = g_strdup(args[1]); else