Changeset 758
- Timestamp:
- 07/07/06 04:14:44 (6 years ago)
- Location:
- branches/ithildin-1.1/modules/ircd
- Files:
-
- 2 edited
-
client.c (modified) (1 diff)
-
commands/nick.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ithildin-1.1/modules/ircd/client.c
r728 r758 139 139 * however, as that is left up to the caller. */ 140 140 void client_change_nick(client_t *cli, char *to) { 141 int casechng ;141 int casechng = !istrcmp(ircd.maps.nick, cli->nick, to); 142 142 143 143 /* check to see if this is just a case change. if it is, istrcmp will 144 144 * return 0. if it's a case change, we don't do anything except set the 145 145 * new nickname in the client structure. */ 146 casechng = !istrcmp(ircd.maps.nick, cli->nick, to); 147 if (!casechng) { 146 if (*cli->nick != '\0' && !casechng) { 148 147 hash_delete(ircd.hashes.client, cli); 149 client_add_history(cli); 150 } 148 149 /* History entries for unregistered clients are extremely useless, 150 * and detrimental sometimes. */ 151 if (CLIENT_REGISTERED(cli)) 152 client_add_history(cli); 153 } 154 151 155 strncpy(cli->nick, to, NICKLEN); 156 152 157 if (!casechng) { 153 158 hash_insert(ircd.hashes.client, cli); 154 hook_event(ircd.events.client_nick, cli); 159 160 /* We only hook client_nick for registered clients, there is little 161 * value in hooking it for nonregistered folks. */ 162 if (CLIENT_REGISTERED(cli)) 163 hook_event(ircd.events.client_nick, cli); 155 164 } 156 165 } -
branches/ithildin-1.1/modules/ircd/commands/nick.c
r757 r758 106 106 sendto_one(cli, RPL_FMT(cli, changeok), argv[1]); 107 107 else if (changeok < 0) { 108 strcpy(cli->nick, argv[1]); 109 /* add the client to the hash immediately to prevent collisions. */ 110 hash_insert(ircd.hashes.client, cli); 108 client_change_nick(cli, argv[1]); 111 109 /* if the username has been filled in then assume the USER command 112 110 * was called as well. */ … … 158 156 * a channel, sendto_common_channels ensures they'll get the message */ 159 157 sendto_common_channels(cli, NULL, "NICK", ":%s", argv[1]); 160 sendto_serv_butone(sptr, cli, NULL, NULL, "NICK", "%s :%d", argv[1],161 cli->ts);158 sendto_serv_butone(sptr, cli, NULL, NULL, "NICK", "%s :%d", 159 argv[1], cli->ts); 162 160 client_change_nick(cli, argv[1]); 163 161
Note: See TracChangeset
for help on using the changeset viewer.
