gaim/gaim

8edf0358144f
Parents 683008a5411b
Children 11caccce199f
I wrote this a while back, I guess I should commit it. It might even
close a SF bug, someone should find out.

This notifies the user if they try to set an erroneous nickname (e.g.
one containing illegal characters) on IRC.
--- a/src/protocols/irc/irc.h Tue Feb 22 23:21:51 2005 -0500
+++ b/src/protocols/irc/irc.h Tue Feb 22 23:42:11 2005 -0500
@@ -98,6 +98,7 @@
void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args);
+void irc_msg_badnick(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_banned(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args);
--- a/src/protocols/irc/msgs.c Tue Feb 22 23:21:51 2005 -0500
+++ b/src/protocols/irc/msgs.c Tue Feb 22 23:42:11 2005 -0500
@@ -746,6 +746,12 @@
g_free(nick);
}
+void irc_msg_badnick(struct irc_conn *irc, const char *name, const char *from, char **args)
+{
+ gaim_connection_error(gaim_account_get_connection(irc->account),
+ _("Your selected account name was rejected by the server. It probably contains invalid characters."));
+}
+
void irc_msg_nickused(struct irc_conn *irc, const char *name, const char *from, char **args)
{
char *newnick, *buf, *end;
--- a/src/protocols/irc/parse.c Tue Feb 22 23:21:51 2005 -0500
+++ b/src/protocols/irc/parse.c Tue Feb 22 23:42:11 2005 -0500
@@ -77,6 +77,7 @@
{ "404", "nt:", irc_msg_nosend }, /* Cannot send to chan */
{ "421", "nv:", irc_msg_unknown }, /* Unknown command */
{ "422", "nv:", irc_msg_endmotd }, /* No MOTD available */
+ { "432", "vn:", irc_msg_badnick }, /* Erroneous nickname */
{ "433", "vn:", irc_msg_nickused }, /* Nickname already in use */
{ "438", "nn:", irc_msg_nochangenick }, /* Nick may not change */
{ "442", "nc:", irc_msg_notinchan }, /* Not in channel */