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:
parent
9e07c8f70b
commit
32d5702869
2 changed files with 29 additions and 0 deletions
|
@ -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 \
|
||||
|
|
28
extensions/hide_uncommon_channels.c
Normal file
28
extensions/hide_uncommon_channels.c
Normal 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)));
|
||||
}
|
Loading…
Reference in a new issue