update_session_deadline(data->client, NULL);
data->approved = CHFL_CHANOP;
- sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is using oper-override on %s (modehacking)",
- get_oper_name(data->client), data->chptr->chname);
+ /* we only want to report modehacks, which are always non-NULL */
+ if (data->modestr)
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is using oper-override on %s (modehacking: %s)",
+ get_oper_name(data->client), data->chptr->chname, data->modestr);
}
}
extern int valid_extban(const char *banstr, struct Client *client_p, struct Channel *chptr, long mode_type);
const char * get_extban_string(void);
-extern int get_channel_access(struct Client *source_p, struct membership *msptr, int dir);
+extern int get_channel_access(struct Client *source_p, struct membership *msptr, int dir, const char *modestr);
extern void send_channel_join(struct Channel *chptr, struct Client *client_p);
#include "logger.h"
#include "chmode.h"
#include "s_assert.h"
+#include "parse.h"
/* bitmasks for error returns, so we send once per call */
#define SM_ERR_NOTS 0x00000001 /* No TS on channel */
}
int
-get_channel_access(struct Client *source_p, struct membership *msptr, int dir)
+get_channel_access(struct Client *source_p, struct membership *msptr, int dir, const char *modestr)
{
hook_data_channel_approval moduledata;
moduledata.target = NULL;
moduledata.approved = is_chanop(msptr) ? CHFL_CHANOP : CHFL_PEON;
moduledata.dir = dir;
+ moduledata.modestr = modestr;
call_hook(h_get_channel_access, &moduledata);
if(MyClient(source_p) && !(targptr->mode.mode & MODE_FREETARGET))
{
if((msptr = find_channel_membership(targptr, source_p)) == NULL ||
- get_channel_access(source_p, msptr, MODE_QUERY) != CHFL_CHANOP)
+ get_channel_access(source_p, msptr, MODE_QUERY, NULL) != CHFL_CHANOP)
{
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
me.name, source_p->name, targptr->chname);
else
fakesource_p = source_p;
- alevel = get_channel_access(source_p, msptr, dir);
+ alevel = get_channel_access(source_p, msptr, dir, reconstruct_parv(parc, parv));
for(; (c = *ml) != 0; ml++)
{
dir = MODE_ADD;
if (!reauthorized)
{
- alevel = get_channel_access(source_p, msptr, dir);
+ alevel = get_channel_access(source_p, msptr, dir, reconstruct_parv(parc, parv));
reauthorized = 1;
}
break;
dir = MODE_DEL;
if (!reauthorized)
{
- alevel = get_channel_access(source_p, msptr, dir);
+ alevel = get_channel_access(source_p, msptr, dir, reconstruct_parv(parc, parv));
reauthorized = 1;
}
break;
}
if(((chptr->mode.mode & MODE_TOPICLIMIT) == 0 ||
- get_channel_access(source_p, msptr, MODE_ADD) >= CHFL_CHANOP) &&
+ get_channel_access(source_p, msptr, MODE_ADD, NULL) >= CHFL_CHANOP) &&
(!MyClient(source_p) ||
can_send(chptr, source_p, msptr)))
{