Added extra params to chat command

This commit is contained in:
- 2022-01-23 04:19:59 -08:00
parent 0a910c3aec
commit e2f55d5f26
1 changed files with 5 additions and 3 deletions

View File

@ -56,7 +56,7 @@ local function msync(s)
local param1 = "?access_token=" .. token local param1 = "?access_token=" .. token
local param2 = "&full_state=false" local param2 = "&full_state=false"
local param3 = "&timeout=5000" local param3 = "&timeout=5000"
local u = MATRIX_SERVER.."/_matrix/client/r0/sync" .. param1 .. param2 .. param3 local u = MATRIX_SERVER.."/_matrix/client/r0/sync" .. param1 .. param2 -- .. param3
if s == nil then -- first time sync if s == nil then -- first time sync
-- do nothing for now -- do nothing for now
else -- second time sync -> append since parameter else -- second time sync -> append since parameter
@ -143,9 +143,11 @@ minetest.register_chatcommand("msync", {
interact = true interact = true
}, },
func = function(name, param) func = function(name, param)
if param == "nil" then if param == "nil" then -- test sync as called from login
msync() msync()
else elseif #param > 1 then -- test sync with specific 'since' parameter
msync(param)
else -- test sync with current since parameter
msync(since) msync(since)
end end
return true, "[matrix_bridge] Fetching from matrix..." return true, "[matrix_bridge] Fetching from matrix..."