From 4e52eb64c71d6e6a25e4033eb87e4659f0107291 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 13 Oct 2013 18:50:07 +0000 Subject: - 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 --- include/client.h | 2 +- modules/core/m_kick.c | 2 +- modules/core/m_sjoin.c | 2 +- modules/m_dline.c | 4 ++-- src/channel_mode.c | 6 +++--- src/client.c | 24 ++++++++++++------------ src/conf.c | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/client.h b/include/client.h index 66227aa..436f6d3 100644 --- a/include/client.h +++ b/include/client.h @@ -466,7 +466,7 @@ extern void dead_link_on_read(struct Client *, int); extern void exit_aborted_clients(void); extern void free_exited_clients(void); extern struct Client *make_client(struct Client *); -extern struct Client *find_chasing(struct Client *, struct Client *, const char *, int *); +extern struct Client *find_chasing(struct Client *, const char *, int *const); extern struct Client *find_person(const struct Client *const, const char *); extern const char *get_client_name(const struct Client *, enum addr_mask_type); diff --git a/modules/core/m_kick.c b/modules/core/m_kick.c index 75a2b84..26dccfa 100644 --- a/modules/core/m_kick.c +++ b/modules/core/m_kick.c @@ -158,7 +158,7 @@ m_kick(struct Client *client_p, struct Client *source_p, if (*user == '\0') return; - if ((who = find_chasing(client_p, source_p, user, &chasing)) == NULL) + if ((who = find_chasing(source_p, user, &chasing)) == NULL) return; if ((ms_target = find_channel_link(who, chptr)) != NULL) diff --git a/modules/core/m_sjoin.c b/modules/core/m_sjoin.c index e9e4532..204bb29 100644 --- a/modules/core/m_sjoin.c +++ b/modules/core/m_sjoin.c @@ -342,7 +342,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, } } while (valid_mode); - target_p = find_chasing(client_p, source_p, s, NULL); + target_p = find_chasing(source_p, s, NULL); /* * if the client doesnt exist, or if its fake direction/server, skip. diff --git a/modules/m_dline.c b/modules/m_dline.c index 08591b0..1df92ef 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -192,7 +192,7 @@ mo_dline(struct Client *client_p, struct Client *source_p, if ((t = parse_netmask(dlhost, NULL, &bits)) == HM_HOST) { - if ((target_p = find_chasing(client_p, source_p, dlhost, NULL)) == NULL) + if ((target_p = find_chasing(source_p, dlhost, NULL)) == NULL) return; if (!MyConnect(target_p)) @@ -311,7 +311,7 @@ ms_dline(struct Client *client_p, struct Client *source_p, return; if ((t = parse_netmask(dlhost, NULL, &bits)) == HM_HOST) { - if ((target_p = find_chasing(client_p, source_p, dlhost, NULL)) == NULL) + if ((target_p = find_chasing(source_p, dlhost, NULL)) == NULL) return; if (!MyConnect(target_p)) 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; } diff --git a/src/conf.c b/src/conf.c index bb6a354..098ec52 100644 --- a/src/conf.c +++ b/src/conf.c @@ -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)) -- cgit