keep in sync with OGN upstream (SVN-317)
[ircu2.10.12-pk.git] / ircd / s_user.c
index 98274901a99323a57bbc8225e07cf722aba4c71e..942c44c96a7b291db160290f3d67164bb82f014d 100644 (file)
@@ -667,7 +667,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
     if (MyUser(sptr)) {
       const char* channel_name;
       struct Membership *member;
-      if (!force && !IsXtraOp(sptr) && (channel_name = find_no_nickchange_channel(sptr))) {
+      if (!force && !IsXtraOp(sptr) && (channel_name = find_no_nickchange_channel(sptr, nick))) {
         return send_reply(cptr, ERR_BANNICKCHANGE, channel_name);
       }
       /*
@@ -1022,8 +1022,11 @@ hide_hostmask(struct Client *cptr, unsigned int flag)
 
   /* spoof also the username if username is passed */
   if(IsFakeIdent(cptr)) {
-    ircd_strncpy(cli_user(cptr)->username, cli_user(cptr)->fakeuser, USERLEN);
-     /* ok, the client is now fully hidden, so let them know -- hikari */
+    if(strncmp(cli_user(cptr)->username, cli_user(cptr)->fakeuser, USERLEN) != 0) {
+      ircd_strncpy(cli_username(cptr), cli_user(cptr)->fakeuser, USERLEN);
+      ircd_strncpy(cli_user(cptr)->username, cli_user(cptr)->fakeuser, USERLEN);
+    }
+    /* ok, the client is now fully hidden, so let them know -- hikari */
     if (MyConnect(cptr))
       send_reply(cptr, RPL_HOSTUSERHIDDEN, cli_user(cptr)->username, cli_user(cptr)->host);
   } else {