0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 15:00:51 +01:00

extensions: add the ability to hide uncommon channels in WHOIS, like in ircd-seven (closes #6)

This commit is contained in:
William Pitcock 2016-01-05 18:44:17 -06:00
parent 9e07c8f70b
commit 32d5702869
2 changed files with 29 additions and 0 deletions

View file

@ -79,6 +79,7 @@ SRCS = \
m_webirc.c \
m_remove.c \
m_roleplay.c \
hide_uncommon_channels.c \
no_kill_services.c \
no_locops.c \
no_oper_invis.c \

View file

@ -0,0 +1,28 @@
/*
* Override WHOIS logic to hide channel memberships that are not common.
* -- kaniini
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_newconf.h"
static void h_huc_doing_whois_channel_visibility(hook_data_client *);
mapi_hfn_list_av1 huc_hfnlist[] = {
{ "doing_whois_channel_visibility", (hookfn) h_huc_doing_whois_channel_visibility },
{ NULL, NULL }
};
DECLARE_MODULE_AV1(hide_uncommon_channels, NULL, NULL, NULL, NULL, huc_hfnlist, "");
static void
h_huc_doing_whois_channel_visibility(hook_data_client *hdata)
{
hdata->approved = ((PubChannel(hdata->chptr) && !IsInvisible(hdata->target)) || IsMember((hdata->client), (hdata->chptr)));
}