I have a feeling this snippet is redundant (not related to the original enquiry)
Code:
if (frame:GetScript("OnShow")) then
frame:HookScript("OnShow", hideTab)
else
frame:SetScript("OnShow", hideTab)
end
:HookScript() should function as :SetScript() automatically if the handler doesn't exist.
So the whole control structure could be simplified to just:
Code:
if frame and not frame.tabHooked then
frame:HookScript("OnShow", hideTab)
frame.tabHide = true
frame.tabHooked = true
frame:Hide()
end
Edit: Also where is the
shown variable defined / gets its value? (used in GetNumActiveChatFrames() function)