mod_bosh: Use message template from mod_http_error
authorKim Alvefur <zash@zash.se>
Sun, 21 Feb 2021 06:17:40 +0100
changeset 11395 8eff5c744395
parent 11394 226fd5d3a295
child 11396 a76493b75dec
mod_bosh: Use message template from mod_http_error Looking Good! And most importantly, consistent.
plugins/mod_bosh.lua
--- a/plugins/mod_bosh.lua	Sun Feb 21 06:15:59 2021 +0100
+++ b/plugins/mod_bosh.lua	Sun Feb 21 06:17:40 2021 +0100
@@ -530,17 +530,15 @@
 	end
 end
 
-local GET_response_body = [[<html><body>
-	<p>It works! Now point your BOSH client to this URL to connect to Prosody.</p>
-	<p>For more information see <a href="https://prosody.im/doc/setting_up_bosh">Prosody: Setting up BOSH</a>.</p>
-	</body></html>]];
-
-local GET_response = {
-	headers = {
-		content_type = "text/html";
-	};
-	body = module:get_option_string("bosh_get_response_body", GET_response_body);
-};
+local function GET_response(event)
+	return module:fire_event("http-message", {
+		response = event.response;
+		---
+		title = "Prosody BOSH endpoint";
+		message = "It works! Now point your BOSH client to this URL to connect to Prosody.";
+		-- <p>For more information see <a href="https://prosody.im/doc/setting_up_bosh">Prosody: Setting up BOSH</a>.</p>
+	}) or "This is the Prosody BOSH endpoint.";
+end
 
 module:depends("http");
 module:provides("http", {