0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-06 05:48:54 +01:00
construct/extensions/hide_uncommon_channels.cc

24 lines
718 B
C++
Raw Normal View History

/*
* Override WHOIS logic to hide channel memberships that are not common.
* -- kaniini
*/
2016-08-13 05:05:54 +02:00
using namespace ircd;
static const char hide_desc[] = "Hides channel memberships not shared";
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_AV2(hide_uncommon_channels, NULL, NULL, NULL, NULL, huc_hfnlist, NULL, NULL, hide_desc);
static void
h_huc_doing_whois_channel_visibility(hook_data_client *hdata)
{
2016-08-24 00:25:09 +02:00
hdata->approved = (is_public(hdata->chptr) && !is(*hdata->target, umode::INVISIBLE)) || is_member(hdata->chptr, hdata->client);
}