I did fix it, but had to do another fix too
This commit is contained in:
60
startup.lua
60
startup.lua
@ -697,16 +697,29 @@ local function handleOutgoingDial()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check if remote iris is closed (for safety, not password prompting)
|
||||||
|
local remoteIrisState = nil
|
||||||
|
if transceiver then
|
||||||
|
remoteIrisState = transceiver.checkConnectedShielding()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Close local iris if remote iris is closed (unsafe for travel)
|
||||||
|
if remoteIrisState and remoteIrisState > 0 then
|
||||||
|
if config.irisEnabled then
|
||||||
|
utils.closeIris()
|
||||||
|
end
|
||||||
|
if remoteIrisState == 100 then
|
||||||
|
utils.log("WARNING: Remote iris is fully closed!")
|
||||||
|
else
|
||||||
|
utils.log("WARNING: Remote iris is " .. remoteIrisState .. "% closed!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local connectionSafe = false
|
local connectionSafe = false
|
||||||
|
|
||||||
-- If remote computer requested a password, show the prompt
|
-- If remote computer requested a password, show the prompt
|
||||||
if state.remotePasswordRequired then
|
if state.remotePasswordRequired then
|
||||||
utils.log("Password required by remote gate")
|
utils.log("Password required by remote gate")
|
||||||
|
|
||||||
-- Close local iris to protect travelers
|
|
||||||
if config.irisEnabled then
|
|
||||||
utils.closeIris()
|
|
||||||
end
|
|
||||||
|
|
||||||
local result = HandlePasswordEntry()
|
local result = HandlePasswordEntry()
|
||||||
|
|
||||||
@ -742,6 +755,14 @@ local function handleOutgoingDial()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Re-check remote iris state after password/GDO attempt
|
||||||
|
if transceiver then
|
||||||
|
remoteIrisState = transceiver.checkConnectedShielding()
|
||||||
|
if not remoteIrisState or remoteIrisState == 0 then
|
||||||
|
connectionSafe = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- If still not safe, show warning
|
-- If still not safe, show warning
|
||||||
if not connectionSafe then
|
if not connectionSafe then
|
||||||
mon.setBackgroundColor(colors.red)
|
mon.setBackgroundColor(colors.red)
|
||||||
@ -757,8 +778,33 @@ local function handleOutgoingDial()
|
|||||||
display.drawDisconnectButton()
|
display.drawDisconnectButton()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- No password required - connection is safe
|
-- No password required - check if remote iris is open
|
||||||
connectionSafe = true
|
if transceiver then
|
||||||
|
remoteIrisState = transceiver.checkConnectedShielding()
|
||||||
|
end
|
||||||
|
|
||||||
|
if not remoteIrisState or remoteIrisState == 0 then
|
||||||
|
-- Remote iris is open - connection is safe
|
||||||
|
connectionSafe = true
|
||||||
|
else
|
||||||
|
-- Remote iris is closed but no password system - show warning
|
||||||
|
utils.log("WARNING: Remote iris closed but no password system available")
|
||||||
|
mon.setBackgroundColor(colors.red)
|
||||||
|
mon.clear()
|
||||||
|
mon.setTextScale(1)
|
||||||
|
mon.setCursorPos(6, 5)
|
||||||
|
mon.write("REMOTE IRIS")
|
||||||
|
mon.setCursorPos(8, 7)
|
||||||
|
if remoteIrisState == 100 then
|
||||||
|
mon.write("CLOSED!")
|
||||||
|
else
|
||||||
|
mon.write(remoteIrisState .. "% CLOSED")
|
||||||
|
end
|
||||||
|
mon.setCursorPos(3, 10)
|
||||||
|
mon.write("Connection unsafe")
|
||||||
|
display.drawIrisStatus()
|
||||||
|
display.drawDisconnectButton()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
utils.log("DEBUG: Before iris opening check - connectionSafe=" ..
|
utils.log("DEBUG: Before iris opening check - connectionSafe=" ..
|
||||||
|
|||||||
Reference in New Issue
Block a user