Skip to content

Commit

Permalink
modules: remove unused spy code.
Browse files Browse the repository at this point in the history
  • Loading branch information
RealKindOne authored and dwfreed committed Jul 24, 2024
1 parent d01a08c commit 4e89f66
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 146 deletions.
22 changes: 0 additions & 22 deletions modules/m_admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ static void mr_admin(struct MsgBuf *, struct Client *, struct Client *, int, con
static void ms_admin(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void do_admin(struct Client *source_p);

static void admin_spy(struct Client *);

struct Message admin_msgtab = {
"ADMIN", 0, 0, 0, 0,
{{mr_admin, 0}, {m_admin, 0}, {ms_admin, 0}, mg_ignore, mg_ignore, {ms_admin, 0}}
Expand Down Expand Up @@ -134,9 +132,6 @@ ms_admin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
static void
do_admin(struct Client *source_p)
{
if(IsPerson(source_p))
admin_spy(source_p);

sendto_one_numeric(source_p, RPL_ADMINME, form_str(RPL_ADMINME), me.name);
if(AdminInfo.name != NULL)
sendto_one_numeric(source_p, RPL_ADMINLOC1, form_str(RPL_ADMINLOC1), AdminInfo.name);
Expand All @@ -145,20 +140,3 @@ do_admin(struct Client *source_p)
if(AdminInfo.email != NULL)
sendto_one_numeric(source_p, RPL_ADMINEMAIL, form_str(RPL_ADMINEMAIL), AdminInfo.email);
}

/* admin_spy()
*
* input - pointer to client
* output - none
* side effects - event doing_admin is called
*/
static void
admin_spy(struct Client *source_p)
{
hook_data hd;

hd.client = source_p;
hd.arg1 = hd.arg2 = NULL;

call_hook(doing_admin_hook, &hd);
}
21 changes: 0 additions & 21 deletions modules/m_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ static const char info_desc[] =
static void send_conf_options(struct Client *source_p);
static void send_birthdate_online_time(struct Client *source_p);
static void send_info_text(struct Client *source_p);
static void info_spy(struct Client *);

static void m_info(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void mo_info(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
Expand Down Expand Up @@ -704,8 +703,6 @@ m_info(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
return;

info_spy(source_p);

send_info_text(source_p);
send_birthdate_online_time(source_p);

Expand All @@ -721,7 +718,6 @@ mo_info(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
{
if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) == HUNTED_ISME)
{
info_spy(source_p);
send_info_text(source_p);

if(IsOperGeneral(source_p))
Expand Down Expand Up @@ -900,20 +896,3 @@ send_conf_options(struct Client *source_p)

sendto_one_numeric(source_p, RPL_INFO, form_str(RPL_INFO), "");
}

/* info_spy()
*
* input - pointer to client
* output - none
* side effects - hook doing_info is called
*/
static void
info_spy(struct Client *source_p)
{
hook_data hd;

hd.client = source_p;
hd.arg1 = hd.arg2 = NULL;

call_hook(doing_info_hook, &hd);
}
21 changes: 0 additions & 21 deletions modules/m_motd.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ mapi_hlist_av1 motd_hlist[] = {

DECLARE_MODULE_AV2(motd, NULL, NULL, motd_clist, motd_hlist, NULL, NULL, NULL, motd_desc);

static void motd_spy(struct Client *);

/*
** m_motd
** parv[1] = servername
Expand All @@ -83,7 +81,6 @@ m_motd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
return;

motd_spy(source_p);
send_user_motd(source_p);
}

Expand All @@ -97,23 +94,5 @@ mo_motd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
return;

motd_spy(source_p);
send_user_motd(source_p);
}

/* motd_spy()
*
* input - pointer to client
* output - none
* side effects - hook doing_motd is called
*/
static void
motd_spy(struct Client *source_p)
{
hook_data data;

data.client = source_p;
data.arg1 = data.arg2 = NULL;

call_hook(doing_motd_hook, &data);
}
60 changes: 1 addition & 59 deletions modules/m_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ static void stats_l_list(struct Client *s, const char *, bool, bool, rb_dlink_li
static void stats_l_client(struct Client *source_p, struct Client *target_p,
char statchar);

static int stats_spy(struct Client *, char, const char *);
static void stats_p_spy(struct Client *);

typedef void (*handler_t)(struct Client *source_p);
typedef void (*handler_parv_t)(struct Client *source_p, int parc, const char *parv[]);

Expand Down Expand Up @@ -206,7 +203,6 @@ m_stats(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
static time_t last_used = 0;
struct stats_cmd *cmd;
unsigned char statchar;
int did_stats = 0;

statchar = parv[1][0];

Expand All @@ -229,14 +225,6 @@ m_stats(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
if(hunt_server(client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME)
return;

if(tolower(statchar) != 'l')
/* FIXME */
did_stats = stats_spy(source_p, statchar, NULL);

/* if did_stats is true, a module grabbed this STATS request */
if(did_stats)
goto stats_out;

/* Look up */
cmd = &stats_cmd_table[statchar];
if(cmd->handler != NULL)
Expand Down Expand Up @@ -272,7 +260,7 @@ m_stats(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
}

stats_out:
/* Send the end of stats notice, and the stats_spy */
/* Send the end of stats notice */
sendto_one_numeric(source_p, RPL_ENDOFSTATS,
form_str(RPL_ENDOFSTATS), statchar);
}
Expand Down Expand Up @@ -817,8 +805,6 @@ stats_operedup (struct Client *source_p)

sendto_one_numeric(source_p, RPL_STATSDEBUG,
"p :%u staff members", count);

stats_p_spy (source_p);
}

static void
Expand Down Expand Up @@ -1515,7 +1501,6 @@ stats_ltrace(struct Client *source_p, int parc, const char *parv[])
}
else if (target_p != NULL)
{
stats_spy(source_p, statchar, target_p->name);
stats_l_client(source_p, target_p, statchar);
}
else
Expand All @@ -1534,8 +1519,6 @@ stats_ltrace(struct Client *source_p, int parc, const char *parv[])
doall = true;
}

stats_spy(source_p, statchar, name);

if (ConfigFileEntry.stats_l_oper_only != STATS_L_OPER_ONLY_NO && !IsOperGeneral(source_p))
{
if (doall && MyClient(source_p))
Expand Down Expand Up @@ -1659,44 +1642,3 @@ stats_comm(struct Client *source_p)
{
rb_dump_fd(rb_dump_fd_callback, source_p);
}

/*
* stats_spy
*
* inputs - pointer to client doing the /stats
* - char letter they are doing /stats on
* output - none
* side effects -
* This little helper function reports to opers if configured.
*/
static int
stats_spy(struct Client *source_p, char statchar, const char *name)
{
hook_data_int data;

data.client = source_p;
data.arg1 = name;
data.arg2 = (int) statchar;
data.result = 0;

call_hook(doing_stats_hook, &data);

return data.result;
}

/* stats_p_spy()
*
* input - pointer to client doing stats
* ouput -
* side effects - call hook doing_stats_p
*/
static void
stats_p_spy (struct Client *source_p)
{
hook_data data;

data.client = source_p;
data.arg1 = data.arg2 = NULL;

call_hook(doing_stats_p_hook, &data);
}
23 changes: 0 additions & 23 deletions modules/m_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ static const char trace_desc[] =

static void m_trace(struct MsgBuf *, struct Client *, struct Client *, int, const char **);

static void trace_spy(struct Client *, struct Client *);

struct Message trace_msgtab = {
"TRACE", 0, 0, 0, 0,
{mg_unreg, {m_trace, 0}, {m_trace, 0}, mg_ignore, mg_ignore, {m_trace, 0}}
Expand Down Expand Up @@ -179,15 +177,11 @@ m_trace(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
tname = target_p->name;
}

trace_spy(source_p, target_p);

sendto_one_numeric(source_p, RPL_ENDOFTRACE,
form_str(RPL_ENDOFTRACE), tname);
return;
}

trace_spy(source_p, NULL);

/* give non-opers a limited trace output of themselves (if local),
* opers and servers (if no shide) --fl
*/
Expand Down Expand Up @@ -430,20 +424,3 @@ report_this_status(struct Client *source_p, struct Client *target_p)

return (cnt);
}

/* trace_spy()
*
* input - pointer to client
* output - none
* side effects - hook event doing_trace is called
*/
static void
trace_spy(struct Client *source_p, struct Client *target_p)
{
hook_data_client hdata;

hdata.client = source_p;
hdata.target = target_p;

call_hook(doing_trace_hook, &hdata);
}

0 comments on commit 4e89f66

Please sign in to comment.