jdhore avatar jdhore committed 298ad67

Added static_quit support. Pretty much what the name implies.

Comments (0)

Files changed (7)

 	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;

doc/reference.conf

 	 */
 	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.
 	char *default_operstring;
 	char *default_adminstring;
 	char *default_operhost;
+	char *static_quit;
 	char *servicestring;
 	char *kline_reason;
 

modules/core/m_quit.c

 		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())
 		"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,
 		&ConfigFileEntry.servicestring,
 	{ "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 },
 	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;	
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.