]> jfr.im git - solanum.git/blame - extensions/hide_uncommon_channels.c
Add .travis.yml
[solanum.git] / extensions / hide_uncommon_channels.c
CommitLineData
32d57028
AC
1/*
2 * Override WHOIS logic to hide channel memberships that are not common.
3 * -- kaniini
4 */
5
6#include "stdinc.h"
7#include "modules.h"
8#include "client.h"
9#include "hook.h"
10#include "ircd.h"
11#include "send.h"
12#include "s_conf.h"
13#include "s_newconf.h"
14
15static void h_huc_doing_whois_channel_visibility(hook_data_client *);
16
17mapi_hfn_list_av1 huc_hfnlist[] = {
18 { "doing_whois_channel_visibility", (hookfn) h_huc_doing_whois_channel_visibility },
19 { NULL, NULL }
20};
21
22DECLARE_MODULE_AV1(hide_uncommon_channels, NULL, NULL, NULL, NULL, huc_hfnlist, "");
23
24static void
25h_huc_doing_whois_channel_visibility(hook_data_client *hdata)
26{
27 hdata->approved = ((PubChannel(hdata->chptr) && !IsInvisible(hdata->target)) || IsMember((hdata->client), (hdata->chptr)));
28}