WoWInterface SVN MorgDKP

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/MorgDKP/libs/AceComm-2.0
    from Rev 22 to Rev 37
    Reverse comparison

Rev 22 → Rev 37

AceComm-2.0.lua
20,6 → 20,8
 
if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0") end
 
local WotLK = not not ToggleAchievementFrame
 
local AceOO = AceLibrary("AceOO-2.0")
local AceComm = AceOO.Mixin {
"SendCommMessage",
1945,30 → 1947,58
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)
2091,41 → 2121,41
 
if not oldLib or not oldLib.hooks or not oldLib.hooks.ChatFrame_MessageEventHandler then
local old_ChatFrame_MessageEventHandler = _G.ChatFrame_MessageEventHandler
function _G.ChatFrame_MessageEventHandler(event)
function _G.ChatFrame_MessageEventHandler(...)
if self.hooks.ChatFrame_MessageEventHandler then
return self.hooks.ChatFrame_MessageEventHandler(self, old_ChatFrame_MessageEventHandler, event)
return self.hooks.ChatFrame_MessageEventHandler(self, old_ChatFrame_MessageEventHandler, ...)
else
return old_ChatFrame_MessageEventHandler(event)
return old_ChatFrame_MessageEventHandler(...)
end
end
end
if not oldLib or not oldLib.hooks or not oldLib.hooks.Logout then
local old_Logout = _G.Logout
function _G.Logout()
function _G.Logout(...)
if self.hooks.Logout then
return self.hooks.Logout(self, old_Logout)
return self.hooks.Logout(self, old_Logout, ...)
else
return old_Logout()
return old_Logout(...)
end
end
end
if not oldLib or not oldLib.hooks or not oldLib.hooks.CancelLogout then
local old_CancelLogout = _G.CancelLogout
function _G.CancelLogout()
function _G.CancelLogout(...)
if self.hooks.CancelLogout then
return self.hooks.CancelLogout(self, old_CancelLogout)
return self.hooks.CancelLogout(self, old_CancelLogout, ...)
else
return old_CancelLogout()
return old_CancelLogout(...)
end
end
end
if not oldLib or not oldLib.hooks or not oldLib.hooks.Quit then
local old_Quit = _G.Quit
function _G.Quit()
function _G.Quit(...)
if self.hooks.Quit then
return self.hooks.Quit(self, old_Quit)
return self.hooks.Quit(self, old_Quit, ...)
else
return old_Quit()
return old_Quit(...)
end
end
end