From f7da763e0f21840f3e915e34a3c1cf3cd59ef07f Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Thu, 13 Jan 2011 17:28:11 +0000 Subject: [PATCH] Add an option to ignore messages from self --- CaptainsLog.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CaptainsLog.lua b/CaptainsLog.lua index 637f4e9..5ffd31e 100644 --- a/CaptainsLog.lua +++ b/CaptainsLog.lua @@ -28,6 +28,9 @@ function addon:Initialize() buffersize = { ["*"] = 10, }, + ignoreself = { + ["*"] = true, + }, showinfeed = { whisper = true, party = true, @@ -52,6 +55,7 @@ function addon:Initialize() }, }) + self.name = UnitName("player") self.messages = self.db.char.messages self:RegisterEvent("CHAT_MSG_WHISPER") @@ -167,6 +171,7 @@ end function addon:CHAT_MSG_WHISPER(event, msg, sender, ...) local mtype = "whisper" if not addon.db.profile.log[mtype] then return end + if sender == self.name and addon.db.profile.ignoreself[mtype] then return end local cname = GetColoredName(event, msg, sender, ...) self:Log(mtype, cname, msg) @@ -176,6 +181,8 @@ end function addon:CHAT_MSG_GUILD(event, msg, sender, ...) local mtype = "guild" if not addon.db.profile.log[mtype] then return end + if sender == self.name and addon.db.profile.ignoreself[mtype] then return end + local cname = GetColoredName(event, msg, sender, ...) self:Log(mtype, cname, msg) self:UpdateFeedText(mtype, cname) @@ -184,6 +191,8 @@ end function addon:CHAT_MSG_PARTY(event, msg, sender, ...) local mtype = "party" if not addon.db.profile.log[mtype] then return end + if sender == self.name and addon.db.profile.ignoreself[mtype] then return end + local cname = GetColoredName(event, msg, sender, ...) self:Log(mtype, cname, msg) self:UpdateFeedText(mtype, cname) @@ -192,6 +201,8 @@ end function addon:CHAT_MSG_BN_WHISPER(event, msg, sender, ...) local mtype = "bnet" if not addon.db.profile.log[mtype] then return end + if sender == self.name and addon.db.profile.ignoreself[mtype] then return end + self:Log(mtype, sender, msg) self:UpdateFeedText(mtype, sender) end @@ -199,6 +210,8 @@ end function addon:CHAT_MSG_RAID(event, msg, sender, ...) local mtype = "raid" if not addon.db.profile.log[mtype] then return end + if sender == self.name and addon.db.profile.ignoreself[mtype] then return end + local cname = GetColoredName(event, msg, sender, ...) self:Log(mtype, cname, msg) self:UpdateFeedText(mtype, cname) -- 1.7.9.5