GetChannelInfo function to return number, name, and category of a channel: NOT TESTED

This commit is contained in:
Andrew Tomaka 2011-06-03 05:42:15 -04:00
parent 71036313e9
commit 2dcf64b159

View file

@ -74,10 +74,14 @@ function core:SetupChatSaver(...)
end
function core:GetChannelInfo(id)
--addon.lua:373
--channelapi.lua:65
--channelapi.lua:55
local channelTable = core:GetChanneltable();
local channelNumber,channelName = GetChannelName(id);
local channelTable = core:GetChannelTable();
if(channelName == nil) then
channelName = channelTable[channelName];
end
return channelNumber,channelName,core:GetChannelCategory(channelNumber);
end
function core:GetChannelTable()
@ -94,6 +98,16 @@ function core:GetChannelTable()
return channelTable;
end
function core:GetChannelCategory(number)
for i = 1,GetNumDisplayChannels(),i do
_,_,channelNumber,_,_,category = GetChannelDisplayInfo(i);
if(channelNumber == number) then
return category;
end
end
end
function core:JoinChannel(msg)
self.hooks[SlashCmdList].JOIN(msg);