X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/1c4d0f3cebae8309d098a660ec01a5ce3b6d6ee0..10f11ca3b5c3b864dc643bf82e5a6c706fb3c98f:/modules/core/m_nick.c diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c index 81d5c6b..62720c1 100644 --- a/modules/core/m_nick.c +++ b/modules/core/m_nick.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_nick.c 3518 2007-06-22 21:59:09Z jilles $ */ #include "stdinc.h" @@ -108,7 +107,6 @@ static int perform_nickchange_collides(struct Client *, struct Client *, struct Client *, int, const char **, time_t, const char *); /* mr_nick() - * parv[0] = sender prefix * parv[1] = nickname */ static int @@ -145,7 +143,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, int parc, const char * if(!clean_nick(nick, 1)) { sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), - me.name, EmptyString(parv[0]) ? "*" : parv[0], parv[1]); + me.name, EmptyString(source_p->name) ? "*" : source_p->name, parv[1]); return 0; } @@ -175,7 +173,6 @@ mr_nick(struct Client *client_p, struct Client *source_p, int parc, const char * } /* m_nick() - * parv[0] = sender prefix * parv[1] = nickname */ static int @@ -208,7 +205,7 @@ m_nick(struct Client *client_p, struct Client *source_p, int parc, const char *p /* check the nickname is ok */ if(!clean_nick(nick, 1)) { - sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], nick); + sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, source_p->name, nick); return 0; } @@ -245,7 +242,7 @@ m_nick(struct Client *client_p, struct Client *source_p, int parc, const char *p change_local_nick(client_p, source_p, nick, 1); } else - sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, parv[0], nick); + sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, source_p->name, nick); return 0; } @@ -258,7 +255,6 @@ m_nick(struct Client *client_p, struct Client *source_p, int parc, const char *p /* mc_nick() * * server -> server nick change - * parv[0] = sender prefix * parv[1] = nickname * parv[2] = TS when nick change */ @@ -389,7 +385,7 @@ ms_uid(struct Client *client_p, struct Client *source_p, int parc, const char *p { char *s = LOCAL_COPY(parv[9]); sendto_realops_snomask(SNO_GENERAL, L_ALL, "Long realname from server %s for %s", - parv[0], parv[1]); + source_p->name, parv[1]); s[REALLEN] = '\0'; parv[9] = s; } @@ -490,7 +486,7 @@ ms_euid(struct Client *client_p, struct Client *source_p, int parc, const char * { char *s = LOCAL_COPY(parv[11]); sendto_realops_snomask(SNO_GENERAL, L_ALL, "Long realname from server %s for %s", - parv[0], parv[1]); + source_p->name, parv[1]); s[REALLEN] = '\0'; parv[11] = s; } @@ -694,6 +690,16 @@ change_local_nick(struct Client *client_p, struct Client *source_p, nick, chptr->chname); return; } + + chptr = find_nonickchange_channel(source_p); + if (chptr != NULL) + { + sendto_one_numeric(source_p, ERR_NONICK, + form_str(ERR_NONICK), + chptr->chname); + return; + } + if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < rb_current_time()) source_p->localClient->number_of_nick_changes = 0;