summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-12-19 20:47:44 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-12-19 20:47:44 +0000
commit4da5460d4491abebff8947b9d09f57e8cf51d615 (patch)
treeaaeda4f7d5326d44a5981c00f5e4447cc77346e9 /modules
parentdf7542c649deea93c52fd46bd88983ab7faa1749 (diff)
- Forward-port -r1685 [STATS q|Q now shows how many times a resv{}
block has been matched] git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1687 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules')
-rw-r--r--modules/core/m_join.c5
-rw-r--r--modules/core/m_nick.c15
2 files changed, 14 insertions, 6 deletions
diff --git a/modules/core/m_join.c b/modules/core/m_join.c
index 7f872f7..badef89 100644
--- a/modules/core/m_join.c
+++ b/modules/core/m_join.c
@@ -97,6 +97,7 @@ m_join(struct Client *client_p, struct Client *source_p,
char *chan_list = NULL;
char *chan = NULL;
struct Channel *chptr = NULL;
+ struct MaskItem *conf = NULL;
int i = 0;
unsigned int flags = 0;
@@ -134,8 +135,10 @@ m_join(struct Client *client_p, struct Client *source_p,
if (!IsExemptResv(source_p) &&
!(HasUMode(source_p, UMODE_OPER) && ConfigFileEntry.oper_pass_resv) &&
- (!hash_find_resv(chan) == ConfigChannel.restrict_channels))
+ (!(conf = hash_find_resv(chan)) == ConfigChannel.restrict_channels))
{
+ if (conf)
+ ++conf->count;
sendto_one(source_p, form_str(ERR_BADCHANNAME),
me.name, source_p->name, chan);
sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE,
diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c
index 8c1d5a8..0f24a10 100644
--- a/modules/core/m_nick.c
+++ b/modules/core/m_nick.c
@@ -195,6 +195,7 @@ mr_nick(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
struct Client *target_p = NULL;
+ struct MaskItem *conf = NULL;
char nick[NICKLEN + 1];
char *s = NULL;
@@ -221,9 +222,10 @@ mr_nick(struct Client *client_p, struct Client *source_p,
}
/* check if the nick is resv'd */
- if (find_matching_name_conf(CONF_NRESV, nick, NULL, NULL, 0) &&
- !IsExemptResv(source_p))
+ if (!IsExemptResv(source_p) &&
+ (conf = find_matching_name_conf(CONF_NRESV, nick, NULL, NULL, 0)))
{
+ ++conf->count;
sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name,
source_p->name[0] ? source_p->name : "*", nick);
sendto_realops_flags(L_ALL, UMODE_REJ, SEND_NOTICE,
@@ -261,6 +263,7 @@ m_nick(struct Client *client_p, struct Client *source_p,
{
char nick[NICKLEN + 1];
struct Client *target_p = NULL;
+ struct MaskItem *conf = NULL;
assert(source_p == client_p);
@@ -286,10 +289,12 @@ m_nick(struct Client *client_p, struct Client *source_p,
return;
}
- if (find_matching_name_conf(CONF_NRESV, nick,
- NULL, NULL, 0) && !IsExemptResv(source_p) &&
- !(HasUMode(source_p, UMODE_OPER) && ConfigFileEntry.oper_pass_resv))
+
+ if (!IsExemptResv(source_p) &&
+ !(HasUMode(source_p, UMODE_OPER) && ConfigFileEntry.oper_pass_resv) &&
+ (conf = find_matching_name_conf(CONF_NRESV, nick, NULL, NULL, 0)))
{
+ ++conf->count;
sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME),
me.name, source_p->name, nick);
sendto_realops_flags(L_ALL, UMODE_REJ, SEND_NOTICE,