diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-10-13 18:50:07 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-10-13 18:50:07 +0000 |
commit | 4e52eb64c71d6e6a25e4033eb87e4659f0107291 (patch) | |
tree | 29f2b78337b3e3a69a63fc7b143272c73b04e3f3 /src | |
parent | da595ec69fae819205c2f5d95d7e16957f82aa58 (diff) |
- find_person(): fixed naming convention
- find_chasing(): reduced required arguments
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2476 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/channel_mode.c | 6 | ||||
-rw-r--r-- | src/client.c | 24 | ||||
-rw-r--r-- | src/conf.c | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/channel_mode.c b/src/channel_mode.c index d486b8d..caeb851 100644 --- a/src/channel_mode.c +++ b/src/channel_mode.c @@ -1030,7 +1030,7 @@ chm_op(struct Client *client_p, struct Client *source_p, opnick = parv[(*parn)++]; - if ((targ_p = find_chasing(client_p, source_p, opnick, NULL)) == NULL) + if ((targ_p = find_chasing(source_p, opnick, NULL)) == NULL) return; if (!IsClient(targ_p)) return; @@ -1136,7 +1136,7 @@ chm_hop(struct Client *client_p, struct Client *source_p, opnick = parv[(*parn)++]; - if ((targ_p = find_chasing(client_p, source_p, opnick, NULL)) == NULL) + if ((targ_p = find_chasing(source_p, opnick, NULL)) == NULL) return; if (!IsClient(targ_p)) return; @@ -1212,7 +1212,7 @@ chm_voice(struct Client *client_p, struct Client *source_p, opnick = parv[(*parn)++]; - if ((targ_p = find_chasing(client_p, source_p, opnick, NULL)) == NULL) + if ((targ_p = find_chasing(source_p, opnick, NULL)) == NULL) return; if (!IsClient(targ_p)) return; diff --git a/src/client.c b/src/client.c index 25ee4c8..64028e9 100644 --- a/src/client.c +++ b/src/client.c @@ -501,34 +501,34 @@ update_client_exit_stats(struct Client *client_p) struct Client * find_person(const struct Client *client_p, const char *name) { - struct Client *c2ptr = NULL; + struct Client *target_p = NULL; if (IsDigit(*name)) { - if ((c2ptr = hash_find_id(name)) != NULL) + if ((target_p = hash_find_id(name)) != NULL) { /* invisible users shall not be found by UID guessing */ - if (HasUMode(c2ptr, UMODE_INVISIBLE)) + if (HasUMode(target_p, UMODE_INVISIBLE)) if (!IsServer(client_p) && !HasFlag(client_p, FLAGS_SERVICE)) - c2ptr = NULL; + target_p = NULL; } } else - c2ptr = hash_find_client(name); + target_p = hash_find_client(name); - return ((c2ptr != NULL && IsClient(c2ptr)) ? c2ptr : NULL); + return (target_p && IsClient(target_p)) ? target_p : NULL; } /* - * find_chasing - find the client structure for a nick name (user) + * find_chasing - find the client structure for a nick name (name) * using history mechanism if necessary. If the client is not found, * an error message (NO SUCH NICK) is generated. If the client was found * through the history, chasing will be 1 and otherwise 0. */ struct Client * -find_chasing(struct Client *client_p, struct Client *source_p, const char *user, int *chasing) +find_chasing(struct Client *source_p, const char *name, int *const chasing) { - struct Client *who = find_person(client_p, user); + struct Client *who = find_person(source_p->from, name); if (chasing) *chasing = 0; @@ -536,15 +536,15 @@ find_chasing(struct Client *client_p, struct Client *source_p, const char *user, if (who) return who; - if (IsDigit(*user)) + if (IsDigit(*name)) return NULL; - if ((who = whowas_get_history(user, + if ((who = whowas_get_history(name, (time_t)ConfigFileEntry.kill_chase_time_limit)) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHNICK), - me.name, source_p->name, user); + me.name, source_p->name, name); return NULL; } @@ -2050,7 +2050,7 @@ find_user_host(struct Client *source_p, char *user_host_or_nick, /* Try to find user@host mask from nick */ /* Okay to use source_p as the first param, because source_p == client_p */ if ((target_p = - find_chasing(source_p, source_p, user_host_or_nick, NULL)) == NULL) + find_chasing(source_p, user_host_or_nick, NULL)) == NULL) return 0; if (IsExemptKline(target_p)) |