Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ SOFTWARE.

local semver = LibStub:GetLibrary("SemanticVersion-1.0")

-- Compatibility shim: Retail moved/removed the old ChatFrame_MessageEventHandler global.
-- Provide gw.ChatFrame_MessageEventHandler so older code keeps working.
gw.ChatFrame_MessageEventHandler = gw.ChatFrame_MessageEventHandler or function(frame, event, ...)
-- Old clients / some builds still have the global:
local g = _G.ChatFrame_MessageEventHandler
if type(g) == "function" then
return g(frame, event, ...)
end

-- Retail: dispatch through the frame’s OnEvent handler (Blizzard chat pipeline)
if frame and frame.GetScript then
local onEvent = frame:GetScript("OnEvent")
if type(onEvent) == "function" then
return onEvent(frame, event, ...)
end
end

-- Last ditch: don't explode. (Optional)
-- You can omit this if you prefer silent failure.
if frame and frame.AddMessage then
local msg = ...
if msg then frame:AddMessage(tostring(msg)) end
end
end

--- Callback handler for guild chat messages.
-- @param type Message type received.
Expand Down