function LastWhispered:OnEnable()
-- Called when the addon is enabled
self:RegisterEvent("CHAT_MSG_WHISPER")
end
function LastWhispered:CHAT_MSG_WHISPER()
self:Print("test")
-- i'm assuming arg2 is name of the last guy who whispered you
if (self.db.profile.whisper1=="") then
self.db.profile.whisper1 = arg2
self:Print(arg2)
-- if whisper1 is nothing then set it to last guy who whispered me; end if statement (and thus the function)
elseif (self.db.profile.whisper2=="") then
self.db.profile.whisper2 = arg2
self:Print(arg2)
-- if whisper1 is set but whisper2 is not then set it to last guy who whispered me; end if statement (and thus the function)
elseif (self.db.profile.whisper3=="") then
self.db.profile.whisper3 = arg2
self:Print(arg2)
elseif (self.db.profile.whisper1~=arg2) then
self.db.profile.whisper1 = arg2
self:Print(arg2)
elseif (self.db.profile.whisper2~=arg2) then
self.db.profile.whisper2 = arg2
self:Print(arg2)
elseif (self.db.profile.whisper3~=arg2) then
self.db.profile.whisper3=arg2
self:Print(arg2)
end
end