update DelayGuildMOTD function in chat

This commit is contained in:
Crum
2018-02-02 23:05:20 -06:00
parent 90c2847d81
commit ed202e0e48
+6 -2
View File
@@ -1416,9 +1416,14 @@ function CH:DelayGuildMOTD()
if delay < 7 then return end if delay < 7 then return end
local msg = GetGuildRosterMOTD() local msg = GetGuildRosterMOTD()
for i = 1, NUM_CHAT_WINDOWS do for i = 1, NUM_CHAT_WINDOWS do
local channel
chat = _G["ChatFrame"..i] chat = _G["ChatFrame"..i]
for k, v in pairs(chat.messageTypeList) do for k, v in pairs(chat.messageTypeList) do
if chat and v == "GUILD" then if v == "GUILD" then
channel = v
end
end
if chat and channel then
if msg and strlen(msg) > 0 then if msg and strlen(msg) > 0 then
local info = ChatTypeInfo["GUILD"] local info = ChatTypeInfo["GUILD"]
local string = format(GUILD_MOTD_TEMPLATE, msg) local string = format(GUILD_MOTD_TEMPLATE, msg)
@@ -1427,7 +1432,6 @@ function CH:DelayGuildMOTD()
chat:RegisterEvent("GUILD_MOTD") chat:RegisterEvent("GUILD_MOTD")
end end
end end
end
this:SetScript("OnUpdate", nil) this:SetScript("OnUpdate", nil)
end) end)
end end