ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/client.c
(Generate patch)

Comparing ircd-hybrid-7.2/src/client.c (file contents):
Revision 880 by michael, Wed Oct 24 21:51:21 2007 UTC vs.
Revision 881 by michael, Sun Oct 28 11:35:29 2007 UTC

# Line 1394 | Line 1394 | change_local_nick(struct Client *client_
1394   {
1395    int samenick = 0;
1396  
1397 +  assert(source_p->name[0] && !EmptyString(nick));
1398 +
1399    /*
1400 <  ** Client just changing his/her nick. If he/she is
1401 <  ** on a channel, send note of change to all clients
1402 <  ** on that channel. Propagate notice to other servers.
1403 <  */
1400 >   * Client just changing his/her nick. If he/she is
1401 >   * on a channel, send note of change to all clients
1402 >   * on that channel. Propagate notice to other servers.
1403 >   */
1404    if ((source_p->localClient->last_nick_change +
1405         ConfigFileEntry.max_nick_time) < CurrentTime)
1406      source_p->localClient->number_of_nick_changes = 0;
# Line 1422 | Line 1424 | change_local_nick(struct Client *client_
1424        del_all_their_accepts(source_p);
1425        source_p->tsinfo = CurrentTime;
1426        clear_ban_cache_client(source_p);
1427 +      watch_check_hash(source_p, RPL_LOGOFF);
1428      }
1429  
1430      /* XXX - the format of this notice should eventually be changed
# Line 1447 | Line 1450 | change_local_nick(struct Client *client_
1450      sendto_server(client_p, source_p, NULL, NOCAPS, CAP_TS6, NOFLAGS,
1451                    ":%s NICK %s :%lu",
1452                    source_p->name, nick, (unsigned long)source_p->tsinfo);
1453 +
1454 +    hash_del_client(source_p);
1455 +    strcpy(source_p->name, nick);
1456 +    hash_add_client(source_p);
1457 +
1458 +    if (!samenick)
1459 +      watch_check_hash(source_p, RPL_LOGON);
1460 +
1461 +    /* fd_desc is long enough */
1462 +    fd_note(&client_p->localClient->fd, "Nick: %s", nick);
1463    }
1464    else
1452  {
1465      sendto_one(source_p, form_str(ERR_NICKTOOFAST),
1466                 me.name, source_p->name, source_p->name,
1467                 nick, ConfigFileEntry.max_nick_time);
1456    return;
1457  }
1458
1459  /* Finally, add to hash */
1460  if (source_p->name[0])
1461    hash_del_client(source_p);
1462
1463  if (!samenick)
1464  {
1465    clear_ban_cache_client(source_p);
1466    watch_check_hash(source_p, RPL_LOGOFF);
1467  }
1468
1469  strcpy(source_p->name, nick);
1470  hash_add_client(source_p);
1471
1472  if (!samenick)
1473    watch_check_hash(source_p, RPL_LOGON);
1474
1475  /* fd_desc is long enough */
1476  fd_note(&client_p->localClient->fd, "Nick: %s", nick);
1468   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)