Cleaner verifying joined channels code
This commit is contained in:
parent
2f596575d8
commit
5331debea4
1 changed files with 4 additions and 11 deletions
|
@ -27,21 +27,14 @@ function core:RejoinChannels(event,message,...)
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
local channelList = {};
|
local currentChannels = {};
|
||||||
for i = 1,select("#",GetChannelList()),2 do
|
for i = 1,select("#",GetChannelList()),2 do
|
||||||
local index,channel = select(i,GetChannelList());
|
local index,channel = select(i,GetChannelList());
|
||||||
channelList[index] = channel;
|
currentChannels[channel] = true;
|
||||||
end
|
end
|
||||||
|
|
||||||
for channel,information in pairs(ChatSaverDB) do
|
for channel,information in pairs(ChatSaverDB) do
|
||||||
local found = false;
|
if(currentChannels[channel] == nil) then
|
||||||
for jIndex,jChannel in pairs(channelList) do
|
|
||||||
if(jChannel == channel) then
|
|
||||||
found = true;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if(found == false) then
|
|
||||||
JoinPermanentChannel(channel);
|
JoinPermanentChannel(channel);
|
||||||
for index,shown in pairs(ChatSaverDB[channel].frames) do
|
for index,shown in pairs(ChatSaverDB[channel].frames) do
|
||||||
if(shown) then
|
if(shown) then
|
||||||
|
|
Loading…
Reference in a new issue