Skip to content

Commit 8980a34

Browse files
committed
gmotd: Just grab the motd before any protections take place
1 parent 2018b66 commit 8980a34

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

gmotd.lua

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22
--[[ GMOTD Module ]]--
33

44
local _, BCM = ...
5-
BCM.modules[#BCM.modules+1] = function()
6-
if bcmDB.BCM_GMOTD or not IsInGuild() then return end
5+
BCM.earlyModules[#BCM.earlyModules+1] = function()
6+
if bcmDB.BCM_GMOTD then return end
77

8+
local gmotd = C_GuildInfo and C_GuildInfo.GetMOTD and C_GuildInfo.GetMOTD() or GetGuildRosterMOTD()
89
BCM.Events.LOADING_SCREEN_DISABLED = function()
910
BCM.Events:UnregisterEvent("LOADING_SCREEN_DISABLED")
1011
BCM.Events.LOADING_SCREEN_DISABLED = nil
12+
BCM.Events:UnregisterEvent("GUILD_MOTD")
13+
BCM.Events.GUILD_MOTD = nil
14+
1115
C_Timer.After(0, function() -- Timers become functional 1 frame after the loading screen is done
1216
C_Timer.After(2, function()
13-
if not C_ChatInfo.InChatMessagingLockdown or not C_ChatInfo.InChatMessagingLockdown() then
14-
local gmotd = GetGuildRosterMOTD()
15-
if not gmotd or gmotd == "" or gmotd:find("^ +$") then return end
16-
local info = ChatTypeInfo.GUILD
17-
ChatFrame1:AddMessage("|cFF33FF99BasicChatMods|r: "..(GUILD_MOTD_TEMPLATE):format(gmotd), info.r, info.g, info.b)
18-
end
17+
if not gmotd or gmotd == "" or gmotd:find("^ +$") then return end
18+
local info = ChatTypeInfo.GUILD
19+
ChatFrame1:AddMessage("|cFF33FF99BasicChatMods|r: "..(GUILD_MOTD_TEMPLATE):format(gmotd), info.r, info.g, info.b)
1920
end)
2021
end)
2122
end
2223
BCM.Events:RegisterEvent("LOADING_SCREEN_DISABLED")
24+
BCM.Events.GUILD_MOTD = function(_, msg)
25+
gmotd = msg
26+
end
27+
BCM.Events:RegisterEvent("GUILD_MOTD")
2328
end
2429

0 commit comments

Comments
 (0)