Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split oper:spy in to oper:spy_user and oper:spy_channel #342

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/s_newconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define IsOperHiddenAdmin(x) (HasPrivilege((x), "oper:hidden_admin"))
#define IsOperAdmin(x) (HasPrivilege((x), "oper:admin") || HasPrivilege((x), "oper:hidden_admin"))
#define IsOperOperwall(x) (HasPrivilege((x), "oper:operwall"))
#define IsOperSpy(x) (HasPrivilege((x), "oper:spy"))
#define IsOperSpyChannel(x) (HasPrivilege((x), "oper:spy_channel"))
#define IsOperSpyUser(x) (HasPrivilege((x), "oper:spy_user"))
#define IsOperInvis(x) (HasPrivilege((x), "oper:hidden"))
#define IsOperRemoteBan(x) (HasPrivilege((x), "oper:remoteban"))
#define IsOperMassNotice(x) (HasPrivilege((x), "oper:mass_notice"))
Expand Down
2 changes: 1 addition & 1 deletion modules/core/m_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ m_mode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p

dest = parv[1];

if(IsOperSpy(source_p) && *dest == '!')
if(IsOperSpyChannel(source_p) && *dest == '!')
{
dest++;
operspy = 1;
Expand Down
4 changes: 2 additions & 2 deletions modules/m_etrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ m_chantrace(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou

name = parv[1];

if(IsOperSpy(source_p) && parv[1][0] == '!')
if(IsOperSpyChannel(source_p) && parv[1][0] == '!')
{
name++;
operspy = 1;
Expand Down Expand Up @@ -347,7 +347,7 @@ mo_masktrace(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
name = LOCAL_COPY(parv[1]);
collapse(name);

if(IsOperSpy(source_p) && parv[1][0] == '!')
if(IsOperSpyUser(source_p) && parv[1][0] == '!')
{
name++;
mask++;
Expand Down
2 changes: 1 addition & 1 deletion modules/m_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ mo_list(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
args = LOCAL_COPY(parv[1]);
}

if (args && *args == '!' && IsOperSpy(source_p))
if (args && *args == '!' && IsOperSpyChannel(source_p))
{
args++;
report_operspy(source_p, "LIST", args);
Expand Down
2 changes: 1 addition & 1 deletion modules/m_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ scan_umodes(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
}
if (target_list == &global_client_list && list_users)
{
if (IsOperSpy(source_p))
if (IsOperSpyUser(source_p))
{
if (!ConfigFileEntry.operspy_dont_care_user_info)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/m_topic.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ m_topic(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_

name = parv[1];

if(IsOperSpy(source_p) && parv[1][0] == '!')
if(IsOperSpyChannel(source_p) && parv[1][0] == '!')
{
name++;
operspy = 1;
Expand Down
8 changes: 2 additions & 6 deletions modules/m_who.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ m_who(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
return;
}

if(IsOperSpy(source_p) && *mask == '!')
if(*mask == '!'
&& HasPrivilege(source_p, IsChannelName(mask + 1) ? "oper:spy_channel" : "oper:spy_user"))
{
mask++;
operspy = 1;
Expand Down Expand Up @@ -268,11 +269,6 @@ m_who(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
last_used = rb_current_time();
}

/* Note: operspy_dont_care_user_info does not apply to
* who on channels */
if(IsOperSpy(source_p) && ConfigFileEntry.operspy_dont_care_user_info)
operspy = 1;

/* '/who 0' for a global list. this forces clients to actually
* request a full list. I presume its because of too many typos
* with "/who" ;) --fl
Expand Down
2 changes: 1 addition & 1 deletion modules/m_whois.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ do_whois(struct Client *client_p, struct Client *source_p, int parc, const char
if((p = strchr(nick, ',')))
*p = '\0';

if(IsOperSpy(source_p) && *nick == '!')
if(IsOperSpyChannel(source_p) && *nick == '!')
{
operspy = 1;
nick++;
Expand Down