Only verify once per session unless forced.
This commit is contained in:
parent
cb91b7ffaa
commit
8e22be74f8
1 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
|||
ChatSaver = LibStub('AceAddon-3.0'):NewAddon('ChatSaver','AceConsole-3.0','AceHook-3.0','AceEvent-3.0');
|
||||
local core = ChatSaver;
|
||||
|
||||
core.verified = false;
|
||||
|
||||
function core:OnInitialize()
|
||||
self:RawHook(SlashCmdList,'JOIN','JoinChannel',true);
|
||||
self:RawHook(SlashCmdList,'LEAVE','LeaveChannel',true);
|
||||
|
@ -16,11 +18,12 @@ function core:OnEnable()
|
|||
end
|
||||
|
||||
function core:SlashCommand()
|
||||
core.verified = false
|
||||
core:RejoinChannels();
|
||||
end
|
||||
|
||||
function core:RejoinChannels(event,message,...)
|
||||
if(message == 'YOU_LEFT') then
|
||||
if(message == 'YOU_LEFT' or core.verified == true) then
|
||||
return;
|
||||
end
|
||||
|
||||
|
@ -47,6 +50,8 @@ function core:RejoinChannels(event,message,...)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
core.verified = true;
|
||||
end
|
||||
|
||||
function core:JoinChannel(msg)
|
||||
|
|
Loading…
Reference in a new issue