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');
|
ChatSaver = LibStub('AceAddon-3.0'):NewAddon('ChatSaver','AceConsole-3.0','AceHook-3.0','AceEvent-3.0');
|
||||||
local core = ChatSaver;
|
local core = ChatSaver;
|
||||||
|
|
||||||
|
core.verified = false;
|
||||||
|
|
||||||
function core:OnInitialize()
|
function core:OnInitialize()
|
||||||
self:RawHook(SlashCmdList,'JOIN','JoinChannel',true);
|
self:RawHook(SlashCmdList,'JOIN','JoinChannel',true);
|
||||||
self:RawHook(SlashCmdList,'LEAVE','LeaveChannel',true);
|
self:RawHook(SlashCmdList,'LEAVE','LeaveChannel',true);
|
||||||
|
@ -16,11 +18,12 @@ function core:OnEnable()
|
||||||
end
|
end
|
||||||
|
|
||||||
function core:SlashCommand()
|
function core:SlashCommand()
|
||||||
|
core.verified = false
|
||||||
core:RejoinChannels();
|
core:RejoinChannels();
|
||||||
end
|
end
|
||||||
|
|
||||||
function core:RejoinChannels(event,message,...)
|
function core:RejoinChannels(event,message,...)
|
||||||
if(message == 'YOU_LEFT') then
|
if(message == 'YOU_LEFT' or core.verified == true) then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,6 +50,8 @@ function core:RejoinChannels(event,message,...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
core.verified = true;
|
||||||
end
|
end
|
||||||
|
|
||||||
function core:JoinChannel(msg)
|
function core:JoinChannel(msg)
|
||||||
|
|
Loading…
Reference in a new issue