Added static_quit support. Pretty much what the name implies.

This commit is contained in:
JD Horelick 2010-03-13 22:19:29 -05:00
parent 8e2b81ee9e
commit c0e2aa60b8
7 changed files with 21 additions and 0 deletions

View File

@ -500,6 +500,7 @@ general {
default_operstring = "is an IRC Operator";
default_adminstring = "is a Server Administrator";
default_operhost = "staff.testnet.net";
#static_quit = "I like turtles!";
servicestring = "is a Network Service";
disable_fake_channels = no;
tkline_expire_notices = no;

View File

@ -1053,6 +1053,11 @@ general {
*/
default_operhost = "staff.testnet.net";
/* static quit: Quit message to display for all users (not opers)
* on QUIT.
*/
#static_quit = "I like turtles!";
/* servicestring: defines the response for opered services (+S)
* in /whois queries, eg "is a Network Service".
* This is updated on rehash.

View File

@ -139,6 +139,7 @@ struct config_file_entry
char *default_operstring;
char *default_adminstring;
char *default_operhost;
char *static_quit;
char *servicestring;
char *kline_reason;

View File

@ -71,6 +71,12 @@ m_quit(struct Client *client_p, struct Client *source_p, int parc, const char *p
comment = reason;
}
if(!IsOper(source_p) && !EmptyString(ConfigFileEntry.static_quit))
{
exit_client(client_p, source_p, source_p, ConfigFileEntry.static_quit);
return 0;
}
if(!IsOper(source_p) &&
(source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
rb_current_time())

View File

@ -157,6 +157,12 @@ static struct InfoStruct info_table[] = {
&ConfigFileEntry.default_operhost,
"Default vhost for operators to receive upon opering up.",
},
{
"static_quit",
OUTPUT_STRING,
&ConfigFileEntry.static_quit,
"Quit message to show for all users.",
},
{
"servicestring",
OUTPUT_STRING,

View File

@ -2188,6 +2188,7 @@ static struct ConfEntry conf_general_table[] =
{ "default_operstring", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.default_operstring },
{ "default_adminstring",CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.default_adminstring },
{ "default_operhost", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.default_operhost },
{ "static_quit", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.static_quit },
{ "servicestring", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.servicestring },
{ "egdpool_path", CF_QSTRING, NULL, MAXPATHLEN, &ConfigFileEntry.egdpool_path },
{ "kline_reason", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.kline_reason },

View File

@ -682,6 +682,7 @@ set_default_conf(void)
ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator");
ConfigFileEntry.default_adminstring = rb_strdup("is a Server Administrator");
ConfigFileEntry.default_operhost = rb_strdup("");
ConfigFileEntry.static_quit = rb_strdup("");
ConfigFileEntry.servicestring = rb_strdup("is a Network Service");
ConfigFileEntry.default_umodes = UMODE_INVISIBLE;