1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-30 05:56:39 +02:00
Files
unrealircd/src/modules/rules.c
T
Bram Matthys fc5569408d Drop the m_ prefix from modules.
So rename src/modules/m_*.c to src/modules/*.c and update makefiles
and modules.default.conf. Also remove m_ at various places in the
source files, but not the CMD_FUNC(), just the module name.
2019-08-12 13:32:58 +02:00

94 lines
1.9 KiB
C

/*
* IRC - Internet Relay Chat, src/modules/out.c
* (C) 2004 The UnrealIRCd Team
*
* See file AUTHORS in IRC package for additional names of
* the programmers.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "unrealircd.h"
CMD_FUNC(m_rules);
#define MSG_RULES "RULES"
ModuleHeader MOD_HEADER(m_rules)
= {
"m_rules",
"4.2",
"command /rules",
"3.2-b8-1",
NULL
};
MOD_INIT(m_rules)
{
CommandAdd(modinfo->handle, MSG_RULES, m_rules, MAXPARA, M_USER);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
MOD_LOAD(m_rules)
{
return MOD_SUCCESS;
}
MOD_UNLOAD(m_rules)
{
return MOD_SUCCESS;
}
/*
* Heavily modified from the ircu m_motd by codemastr
* Also svsmotd support added
*/
CMD_FUNC(m_rules)
{
ConfigItem_tld *ptr;
aMotdLine *temp;
temp = NULL;
if (hunt_server(cptr, sptr, recv_mtags, ":%s RULES :%s", 1, parc, parv) != HUNTED_ISME)
return 0;
ptr = Find_tld(sptr);
if (ptr)
temp = ptr->rules.lines;
if(!temp)
temp = rules.lines;
if (temp == NULL)
{
sendnumeric(sptr, ERR_NORULES);
return 0;
}
sendnumeric(sptr, RPL_RULESSTART, me.name);
while (temp)
{
sendnumeric(sptr, RPL_RULES,
temp->line);
temp = temp->next;
}
sendnumeric(sptr, RPL_ENDOFRULES);
return 0;
}