mod_muc_log_http/muc_log_http/mod_muc_log_http.lua
changeset 578 1a575bcbc843
parent 393 20ef4a289d7d
child 579 513aa6fed9e9
equal deleted inserted replaced
577:d26436bdfd5c 578:1a575bcbc843
    84 	end
    84 	end
    85 	return t;
    85 	return t;
    86 end
    86 end
    87 
    87 
    88 function createDoc(body, title)
    88 function createDoc(body, title)
    89 	assert(body, "<nil> HTTP response");
    89 	if not body then
       
    90 		return { status = "404 Not Found", body = "<h1>Page Not Found</h1>Sorry, we couldn't find what you were looking for :(" };
       
    91 	end
    90 	body = body:gsub("%%", "%%%%");
    92 	body = body:gsub("%%", "%%%%");
    91 	return html.doc:gsub("###BODY_STUFF###", body)
    93 	return html.doc:gsub("###BODY_STUFF###", body)
    92 		:gsub("<title>muc_log</title>", "<title>"..(title and htmlEscape(title) or "Chatroom logs").."</title>");
    94 		:gsub("<title>muc_log</title>", "<title>"..(title and htmlEscape(title) or "Chatroom logs").."</title>");
    93 end
    95 end
    94 
    96