+ virtual int OnUserPreNick(userrec* user, const std::string &newnick)
+ {
+ if (IS_LOCAL(user))
+ {
+ if (isdigit(newnick[0])) /* don't even think about touching a switch to uid! */
+ return 0;
+
+ for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
+ {
+ chanrec* curr = i->first;
+
+ if (curr->IsModeSet('N'))
+ {
+ if (CHANOPS_EXEMPT(ServerInstance, 'N') && curr->GetStatus(user) == STATUS_OP)
+ continue;
+
+ user->WriteServ("447 %s :Can't change nickname while on %s (+N is set)", user->nick, curr->name);
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+ }
+};