/* Copyright (C) All Rights Reserved ** Written by k4be ** License: GPLv3 https://www.gnu.org/licenses/gpl-3.0.html */ #include "unrealircd.h" char *ct_isupport_param(void); extern MODVAR MessageTagHandler *mtaghandlers; ModuleHeader MOD_HEADER = { "third/clienttagdeny", "5.0", "Informs clients about supported client tags", "k4be@PIRC", "unrealircd-5", }; MOD_INIT(){ return MOD_SUCCESS; } MOD_LOAD(){ ISupportAdd(modinfo->handle, "CLIENTTAGDENY", ct_isupport_param()); return MOD_SUCCESS; } MOD_UNLOAD(){ return MOD_SUCCESS; } #define BUFLEN 500 char *ct_isupport_param(void){ static char buf[BUFLEN]; int count = 0; MessageTagHandler *m; strcpy(buf, "*"); for (m = mtaghandlers; m; m = m->next) { if(m->name[0] == '+'){ strncat(buf, ",-", BUFLEN-1); strncat(buf, m->name+1, BUFLEN-1); count++; } } return buf; }