comparison 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
comparison
equal deleted inserted replaced
4175:39d1a4ecdee6 4176:0016618e0975
1 -- mod_conversejs 1 -- mod_conversejs
2 -- Copyright (C) 2017 Kim Alvefur 2 -- Copyright (C) 2017 Kim Alvefur
3 3
4 local json_encode = require"util.json".encode; 4 local json_encode = require"util.json".encode;
5 local xml_escape = require "util.stanza".xml_escape; 5 local xml_escape = require "util.stanza".xml_escape;
6 local urlencode = require "util.http".urlencode;
6 local render = require "util.interpolation".new("%b{}", xml_escape, { json = json_encode }); 7 local render = require "util.interpolation".new("%b{}", xml_escape, { json = json_encode });
7 8
8 module:depends"http"; 9 module:depends"http";
9 10
10 local has_bosh = pcall(function () 11 local has_bosh = pcall(function ()
134 end; 135 end;
135 ["GET /dist/*"] = serve_dist; 136 ["GET /dist/*"] = serve_dist;
136 } 137 }
137 }); 138 });
138 139
140 module:provides("site-app", {
141 name = "Converse.js";
142 text = [[A free and open-source XMPP chat client in your browser]];
143 image = "assets/logos/converse-js.svg";
144 link = "https://conversejs.org/";
145 magic_link_format = "/register?t={invite.token}&c=converse-js";
146 login_link_format = module:http_url();
147 platforms = { "Web" };
148 download = {
149 buttons = {
150 {
151 text = "Open web chat";
152 url = module:http_url();
153 };
154 };
155 };
156
157 });