2016-01-06 01:44:17 +01:00
|
|
|
/*
|
|
|
|
* Override WHOIS logic to hide channel memberships that are not common.
|
|
|
|
* -- kaniini
|
|
|
|
*/
|
|
|
|
|
2016-08-13 05:05:54 +02:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 08:29:41 +01:00
|
|
|
static const char hide_desc[] = "Hides channel memberships not shared";
|
|
|
|
|
2016-01-06 01:44:17 +01:00
|
|
|
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 }
|
|
|
|
};
|
|
|
|
|
2016-03-07 10:08:40 +01:00
|
|
|
DECLARE_MODULE_AV2(hide_uncommon_channels, NULL, NULL, NULL, NULL, huc_hfnlist, NULL, NULL, hide_desc);
|
2016-01-06 01:44:17 +01:00
|
|
|
|
|
|
|
static void
|
|
|
|
h_huc_doing_whois_channel_visibility(hook_data_client *hdata)
|
|
|
|
{
|
2016-08-19 01:33:46 +02:00
|
|
|
hdata->approved = (is_public(hdata->chptr) && !IsInvisible(hdata->target)) || is_member(hdata->chptr, hdata->client);
|
2016-01-06 01:44:17 +01:00
|
|
|
}
|