integrate with yl_matterbridge

This commit is contained in:
localhost_frssoft 2023-10-03 16:28:50 +03:00
parent 81e3bbcdc3
commit c433898c26
3 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@ fediauth = {
-- baseXX functions
basexx = loadfile(MP.."/basexx.lua")(),
}
fediauth.matterbridge_avalaible = minetest.get_modpath("yl_matterbridge") and true
dofile(MP.."/mastoapi.lua")
local instance = minetest.settings:get("fediauth.instance")

View File

@ -1,2 +1,4 @@
name = fediauth
min_minetest_version = 5.3
optional_depends = yl_matterbridge

View File

@ -17,7 +17,11 @@ function fediauth.discard_passw(playername)
if stored_pwd == auth_data.password then
fediauth.storage:set_string(playername .. "_pwd", "")
else
minetest.log("warning", "[fediauth] '" .. playername .. "' attempt change password! Restoring")
local msg_violation = "[fediauth] '" .. playername .. "' attempt change password! Restoring"
minetest.log("warning", msg_violation)
if fediauth.matterbridge_avalaible then
yl_matterbridge.send_to_bridge("", msg_violation)
end
minetest.kick_player(playername, "password protection violation")
minetest.set_player_password(playername, stored_pwd)