1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-03 17:23:13 +02:00
Files
unrealircd/src/modules/extbans/partmsg.c
T
Bram Matthys 23116d344a Give structs the same name as the typedefs. Rename aClient to Client,
aChannel to Channel, and some more. Third party module coders will
love this. But.. it makes things more logical and the doxygen output
will look more clean and logical as well.
(More changes will follow)
2019-09-11 09:48:00 +02:00

72 lines
1.8 KiB
C

/*
* Hide Part/Quit message extended ban (+b ~p:nick!user@host)
* (C) Copyright i <info@servx.org> and the UnrealIRCd team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "unrealircd.h"
ModuleHeader MOD_HEADER(partmsg)
= {
"chanmodes/extbans/partmsg",
"4.2",
"ExtBan ~p - Ban/exempt Part/Quit message",
"UnrealIRCd Team",
"unrealircd-5",
};
int extban_partmsg_is_banned(Client *sptr, Channel *chptr, char *banin, int type, char **msg, char **errmsg);
MOD_INIT(partmsg)
{
ExtbanInfo req;
req.flag = 'p';
req.is_ok = extban_is_ok_nuh_extban;
req.conv_param = extban_conv_param_nuh_or_extban;
req.options = EXTBOPT_ACTMODIFIER;
req.is_banned = extban_partmsg_is_banned;
if (!ExtbanAdd(modinfo->handle, req))
{
config_error("could not register extended ban type");
return MOD_FAILED;
}
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
/** Called upon module load */
MOD_LOAD(partmsg)
{
return MOD_SUCCESS;
}
/** Called upon unload */
MOD_UNLOAD(partmsg)
{
return MOD_SUCCESS;
}
int extban_partmsg_is_banned(Client *sptr, Channel *chptr, char *banin, int type, char **msg, char **errmsg)
{
if (type == BANCHK_LEAVE_MSG)
*msg = NULL;
return 0;
}