#include "unrealircd.h"
#define OVR_WEBIRC "WEBIRC"
#define OVR_JOIN "JOIN"
static int showwebirc_overridewebirc(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, char *parv[]);
static ModuleInfo *showwebircMI = NULL;
Cmdoverride *showwebircOVRWebirc;
ModuleHeader MOD_HEADER(m_showwebirc) = {
"m_showwebirc",
"$Id: v0.01 2018/12/14 k4be$",
"Add Y usermode for WEBIRC users",
"3.2-b8-1",
NULL
};
long showwebirc_umode;
MOD_INIT(m_listrestrict) {
showwebircMI = modinfo;
if(!UmodeAdd(modinfo->handle, 'Y', UMODE_GLOBAL, 0, umode_allow_none, &showwebirc_umode)) return MOD_FAILED;
return MOD_SUCCESS;
}
MOD_LOAD(m_showwebirc) {
showwebircOVRWebirc = CmdoverrideAdd(showwebircMI->handle, OVR_WEBIRC, showwebirc_overridewebirc);
if(ModuleGetError(showwebircMI->handle) != MODERR_NOERROR || !showwebircOVRWebirc) {
return MOD_FAILED;
}
return MOD_SUCCESS;
}
MOD_UNLOAD(m_showwebirc) {
return MOD_SUCCESS;
}
static int showwebirc_overridewebirc(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, char *parv[]) {
/* Gets args: Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, char *parv[]
**
** ovr: Pointer to the override we're attached to
** cptr: Pointer to directly attached client -- if remote user this is the remote server instead
** sptr: Pointer to user executing command
** parc: Amount of arguments (also includes the command in the count)
** parv: Contains the actual args, first one starts at parv[1]
**
*/
long old = sptr->umodes;
sptr->umodes |= showwebirc_umode;
send_umode_out(sptr, sptr, old);
return CallCmdoverride(ovr, cptr, sptr, parc, parv);
}