local BNGetFriendToonInfo, BNGetNumFriends, BNGetNumFriendToons, CanComplainChat, GetAutoDeclineGuildInvites, IsInGuild, UnitInParty, UnitInRaid, UnitIsInMyGuild |
= BNGetFriendToonInfo, BNGetNumFriends, BNGetNumFriendToons, CanComplainChat, GetAutoDeclineGuildInvites, IsInGuild, UnitInParty, UnitInRaid, UnitIsInMyGuild |
|
local function debug(lvl, str, ...) |
if str then |
if (...) then |
if type(str) == "string" and strmatch(str, "%%[dfqsx%d%.]") then |
DEFAULT_CHAT_FRAME:AddMessage("|cffffcc33[NoGuild]|r " .. format(str, ...)) |
else |
DEFAULT_CHAT_FRAME:AddMessage("|cffffcc33[NoGuild]|r " .. strjoin(" ", tostringall(str, ...))) |
end |
local function debug(str, ...) |
if (...) then |
if type(str) == "string" and strmatch(str, "%%[dfqsx%d%.]") then |
DEFAULT_CHAT_FRAME:AddMessage("|cffffcc33[NoGuild]|r " .. format(str, ...)) |
else |
DEFAULT_CHAT_FRAME:AddMessage("|cffffcc33[NoGuild]|r " .. tostring(str)) |
DEFAULT_CHAT_FRAME:AddMessage("|cffffcc33[NoGuild]|r " .. strjoin(" ", tostringall(str, ...))) |
end |
elseif str then |
DEFAULT_CHAT_FRAME:AddMessage("|cffffcc33[NoGuild]|r " .. tostring(str)) |
end |
end |
|
------------------------------------------------------------------------ |
|
local last, result |
local seen, last, result = {} |
|
local function exspaminate(self, event, message, sender, _, _, _, flag, _, _, _, _, line, guid) |
local function exspaminate(self, event, message, sender, _, _, _, flag, _, channelID, _, _, line, guid) |
if line == last then |
return result |
end |
last, result = line, nil |
|
if GetAutoDeclineGuildInvites() == 0 and not IsInGuild() then |
return -- debug("ALLOWED [GetAutoDeclineGuildInvites]", tostring(GetAutoDeclineGuildInvites()), "[IsInGuild]", tostring(IsInGuild())) |
end |
|
-- debug("[flag]", tostring(flag), "[line]", tostring(line), "[CanComplainChat]", tostring(CanComplainChat(line))) |
|
if flag == "GM" or flag == "DEV" then |
return -- debug("ALLOWED [flag]", flag) |
return --debug("ALLOWED [flag]", flag) |
end |
|
if event == "CHAT_MSG_CHANNEL" and (channelId == 0 or type(channelId) ~= "number") then |
if event == "CHAT_MSG_CHANNEL" and (channelID == 0 or type(channelID) ~= "number") then |
-- Ignore custom channels |
return |
return --debug("ALLOWED custom channel", channelID) |
end |
|
if not CanComplainChat(line) or UnitIsInMyGuild(sender) or UnitInRaid(sender) or UnitInParty(sender) then |
return --[[ debug("ALLOWED", |
"[CanComplainChat]", tostring(CanComplainChat(line) or "nil"), |
"[UnitIsInMyGuild]", tostring(UnitIsInMyGuild(sender) or "nil"), |
"[UnitInRaid]", tostring(UnitInRaid(sender) or "nil"), |
"[UnitInParty]", tostring(UnitInParty(sender) or "nil")) ]] |
"[CanComplainChat]", CanComplainChat(line), |
"[UnitIsInMyGuild]", UnitIsInMyGuild(sender), |
"[UnitInRaid]", UnitInRaid(sender), |
"[UnitInParty]", UnitInParty(sender)) ]] |
end |
|
if event == "CHAT_MSG_WHISPER" then |