local notSeenString = '^' .. _G.ERR_CHAT_PLAYER_NOT_FOUND_S:gsub("%%s", "(.-)"):gsub("%%1%$s", "(.-)") .. '$' |
local ambiguousString = '^' .. _G.ERR_CHAT_PLAYER_AMBIGUOUS_S:gsub("%%s", "(.-)"):gsub("%%1%$s", "(.-)") .. '$' |
local ERR_GUILD_PERMISSIONS = _G.ERR_GUILD_PERMISSIONS |
function AceComm.hooks:ChatFrame_MessageEventHandler(orig, event) |
if (event == "CHAT_MSG_CHANNEL" or event == "CHAT_MSG_CHANNEL_LIST") and _G.arg9:find("^AceComm") then |
return |
elseif event == "CHAT_MSG_SYSTEM" then |
local arg1 = _G.arg1 |
if arg1 == ERR_GUILD_PERMISSIONS then |
if recentGuildMessage > GetTime() then |
stopGuildMessages = true |
return |
if WotLK then |
function AceComm.hooks:ChatFrame_MessageEventHandler(orig, hookSelf, event, ...) |
if (event == "CHAT_MSG_CHANNEL" or event == "CHAT_MSG_CHANNEL_LIST") and _G.arg9:find("^AceComm") then |
return |
elseif event == "CHAT_MSG_SYSTEM" then |
local arg1 = _G.arg1 |
if arg1 == ERR_GUILD_PERMISSIONS then |
if recentGuildMessage > GetTime() then |
stopGuildMessages = true |
return |
end |
else |
local player = arg1:match(notSeenString) or arg1:match(ambiguousString) |
if player then |
local t = GetTime() |
if recentNotSeen[player] and recentNotSeen[player] > t then |
recentNotSeen[player] = t + 10 |
return |
else |
recentNotSeen[player] = t + 10 |
end |
end |
end |
else |
local player = arg1:match(notSeenString) or arg1:match(ambiguousString) |
if player then |
local t = GetTime() |
if recentNotSeen[player] and recentNotSeen[player] > t then |
recentNotSeen[player] = t + 10 |
end |
return orig(hookSelf, event, ...) |
end |
else |
function AceComm.hooks:ChatFrame_MessageEventHandler(orig, event) |
if (event == "CHAT_MSG_CHANNEL" or event == "CHAT_MSG_CHANNEL_LIST") and _G.arg9:find("^AceComm") then |
return |
elseif event == "CHAT_MSG_SYSTEM" then |
local arg1 = _G.arg1 |
if arg1 == ERR_GUILD_PERMISSIONS then |
if recentGuildMessage > GetTime() then |
stopGuildMessages = true |
return |
else |
recentNotSeen[player] = t + 10 |
end |
else |
local player = arg1:match(notSeenString) or arg1:match(ambiguousString) |
if player then |
local t = GetTime() |
if recentNotSeen[player] and recentNotSeen[player] > t then |
recentNotSeen[player] = t + 10 |
return |
else |
recentNotSeen[player] = t + 10 |
end |
end |
end |
end |
return orig(event) |
end |
return orig(event) |
end |
|
function AceComm.hooks:Logout(orig) |