Make Open Mail recovery lazy and bump to 1.4.12
- Leave the existing Open Mail button untouched during normal mailbox opens - Only run full recovery if the button is missing, hidden or re-parented - Match Otari-style normal behavior while keeping compatibility recovery - Keep Open All, inbox polling, sending and logging unchanged - Bump version to 1.4.12
This commit is contained in:
+15
-4
@@ -8,7 +8,7 @@ local m = TurtleMail
|
||||
local getn = table.getn
|
||||
local function pack( ... ) return arg end
|
||||
|
||||
m.compat_version = "1.4.11"
|
||||
m.compat_version = "1.4.12"
|
||||
|
||||
local DEFAULT_SENT_FILTERS = {
|
||||
Money = 1,
|
||||
@@ -475,11 +475,22 @@ end
|
||||
|
||||
-- Safer MAIL_SHOW: package-button regions differ between UI replacements.
|
||||
function m.MAIL_SHOW()
|
||||
-- Re-assert the legacy references whenever the mailbox opens. This also
|
||||
-- recovers if another UI addon changed those globals after addon loading.
|
||||
-- Re-assert the legacy send-widget references whenever the mailbox opens.
|
||||
-- Open Mail follows the lighter Otari-style path: when the existing button
|
||||
-- is still shown and parented to InboxFrame, do nothing at all. Only invoke
|
||||
-- the full recovery routine if the button is missing, hidden, or re-parented.
|
||||
ensure_send_mail_button()
|
||||
ensure_subject_edit_box()
|
||||
ensure_open_mail_button()
|
||||
|
||||
local open_mail_button = m.api.TurtleMailOpenMailButton
|
||||
local open_mail_ok = open_mail_button
|
||||
and type( open_mail_button.SetPoint ) == "function"
|
||||
and (not open_mail_button.GetParent or open_mail_button:GetParent() == m.api.InboxFrame)
|
||||
and (not open_mail_button.IsShown or open_mail_button:IsShown())
|
||||
|
||||
if not open_mail_ok then
|
||||
ensure_open_mail_button()
|
||||
end
|
||||
|
||||
if not m.api.MailFrame then return end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user