view mod_captcha_registration/install.lua @ 3656:3e0f4d727825

mod_vcard_muc: Add an alternative method of signaling avatar change When the avatar has been changed, a signal is sent that the room configuration has changed. Clients then do a disco#info query to find the SHA-1 of the new avatar. They can then fetch it as before, or not if they have it cached already. This is meant to be less disruptive than signaling via presence, which caused problems for some clients. If clients transition to the new method, the old one can eventually be removed. The namespace is made up while waiting for standardization. Otherwise it is very close to what's described in https://xmpp.org/extensions/inbox/muc-avatars.html
author Kim Alvefur <zash@zash.se>
date Sun, 25 Aug 2019 20:46:43 +0200
parents 985bfc6e8cad
children
line wrap: on
line source

-- simple installer for mod_register with dependicies

files = {"util/dataforms.lua", "modules/mod_register.lua", "FiraSans-Regular.ttf"}

default_path = "/usr/lib/prosody"


function exists(name)
	if type(name) ~= "string" then return false end
	return os.rename(name, name) and true or false
end

function copy_file(name, target)
	local file = io.open(name)
	local data = file:read("*all")
	file:close()
	local file = io.open(target, "w")
	file:write(data)
	file:close()
end

function copy_files(path)
	for index = 1, #files do
		local filename = files[index]
		os.remove(default_path.."/"..filename)
		copy_file(filename, default_path.."/"..filename)
		print("copied: "..default_path.."/"..filename)
	end
end

if not exists(default_path) then
	io.write("\nEnter prosody path [/usr/lib/prosody]: ")
	path = io.read("*line")
end

copy_files(path or default_path)