Only store valid channle names.

This commit is contained in:
Andrew Tomaka 2011-05-26 00:01:58 -04:00
parent 8bac341153
commit 4f7e7f40ae

View file

@ -39,7 +39,6 @@ function core:RejoinChannels(event,message,...)
end end
if(found == false) then if(found == false) then
print('Chat Saver: Restoring lost channel, ',channel);
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
@ -55,10 +54,12 @@ function core:JoinChannel(msg)
local name = gsub(msg, "%s*([^%s]+).*", "%1"); local name = gsub(msg, "%s*([^%s]+).*", "%1");
ChatSaverDB[name] = {}; if(strlen(name) > 0 and string.match(name,"%a+")) then
ChatSaverDB[name]['frames'] = {}; ChatSaverDB[name] = {};
ChatSaverDB[name]['index'] = GetChannelName(name); ChatSaverDB[name]['frames'] = {};
ChatSaverDB[name]['frames'][DEFAULT_CHAT_FRAME:GetID()] = true; ChatSaverDB[name]['index'] = GetChannelName(name);
ChatSaverDB[name]['frames'][DEFAULT_CHAT_FRAME:GetID()] = true;
end
end end
function core:LeaveChannel(msg) function core:LeaveChannel(msg)