diff mod_conversejs/mod_conversejs.lua @ 4176:0016618e0975

mod_conversejs: Automatically register as a site app (see mod_register_apps)
author Matthew Wild <mwild1@gmail.com>
date Tue, 06 Oct 2020 16:07:43 +0100
parents 6b2a1c9ef6e2
children 37aa50ed79c1
line wrap: on
line diff
--- a/mod_conversejs/mod_conversejs.lua	Tue Oct 06 16:06:57 2020 +0100
+++ b/mod_conversejs/mod_conversejs.lua	Tue Oct 06 16:07:43 2020 +0100
@@ -3,6 +3,7 @@
 
 local json_encode = require"util.json".encode;
 local xml_escape = require "util.stanza".xml_escape;
+local urlencode = require "util.http".urlencode;
 local render = require "util.interpolation".new("%b{}", xml_escape, { json = json_encode });
 
 module:depends"http";
@@ -136,3 +137,21 @@
 	}
 });
 
+module:provides("site-app", {
+	name = "Converse.js";
+	text = [[A free and open-source XMPP chat client in your browser]];
+	image = "assets/logos/converse-js.svg";
+	link = "https://conversejs.org/";
+	magic_link_format = "/register?t={invite.token}&c=converse-js";
+	login_link_format = module:http_url();
+	platforms = { "Web" };
+	download = {
+		buttons = {
+			{
+				text = "Open web chat";
+				url = module:http_url();
+			};
+		};
+	};
+
+});