@@ -21,7 +21,6 @@ local GetBNPlayerCommunityLink = GetBNPlayerCommunityLink
2121local GetChannelName = GetChannelName
2222local GetChatWindowInfo = GetChatWindowInfo
2323local GetCursorPosition = GetCursorPosition
24- local GetGuildRosterMOTD = GetGuildRosterMOTD
2524local GetInstanceInfo = GetInstanceInfo
2625local GetNumGroupMembers = GetNumGroupMembers
2726local GetPlayerCommunityLink = GetPlayerCommunityLink
@@ -68,6 +67,7 @@ local GetGroupQueues = E.Retail and C_SocialQueue.GetGroupQueues
6867local GetCVar = C_CVar .GetCVar
6968local GetCVarBool = C_CVar .GetCVarBool
7069
70+ local GetGuildRosterMOTD = C_GuildInfo .GetMOTD or GetGuildRosterMOTD
7171local C_ClassColor_GetClassColor = C_ClassColor and C_ClassColor .GetClassColor
7272local IsTimerunningPlayer = C_ChatInfo .IsTimerunningPlayer
7373local IsChatLineCensored = C_ChatInfo .IsChatLineCensored
@@ -2961,11 +2961,14 @@ end
29612961tremove (_G .ChatTypeGroup .GUILD , 2 )
29622962function CH :DelayGuildMOTD ()
29632963 local delay , checks , delayFrame = 0 , 0 , CreateFrame (' Frame' )
2964+
29642965 tinsert (_G .ChatTypeGroup .GUILD , 2 , ' GUILD_MOTD' )
2966+
29652967 delayFrame :SetScript (' OnUpdate' , function (df , elapsed )
29662968 delay = delay + elapsed
2969+
29672970 if delay < 5 then return end
2968- local msg = GetGuildRosterMOTD ()
2971+ local msg = not InCombatLockdown () and GetGuildRosterMOTD ()
29692972 if msg and strlen (msg ) > 0 then
29702973 for _ , frameName in ipairs (_G .CHAT_FRAMES ) do
29712974 local chat = _G [frameName ]
@@ -2974,9 +2977,11 @@ function CH:DelayGuildMOTD()
29742977 chat :RegisterEvent (' GUILD_MOTD' )
29752978 end
29762979 end
2980+
29772981 df :SetScript (' OnUpdate' , nil )
29782982 else -- 5 seconds can be too fast for the API response. let's try once every 5 seconds (max 5 checks).
29792983 delay , checks = 0 , checks + 1
2984+
29802985 if checks >= 5 then
29812986 df :SetScript (' OnUpdate' , nil )
29822987 end
0 commit comments