Commit 33a72e26 authored by Simpy's avatar Simpy 🐹

it seems the problem with `ElvUIGVC` is that it existed at all. this commit...

it seems the problem with `ElvUIGVC` is that it existed at all. this commit solves the problem but elimation. good-bye!
parent 5426464d
......@@ -82,7 +82,7 @@ function lib:RegisterPlugin(name, callback, isLib)
C_ChatInfo_RegisterAddonMessagePrefix(lib.prefix)
lib.VCFrame:RegisterEvent('CHAT_MSG_ADDON')
lib.VCFrame:RegisterEvent('GROUP_ROSTER_UPDATE')
lib.VCFrame:RegisterEvent('LOADING_SCREEN_DISABLED')
lib.VCFrame:RegisterEvent('PLAYER_ENTERING_WORLD')
lib.registeredPrefix = true
end
......@@ -191,8 +191,8 @@ function lib:VersionCheck(event, prefix, message, _, sender)
end
lib.groupSize = num
end
elseif event == 'LOADING_SCREEN_DISABLED' then
lib:DelayedSendVersionCheck(35) -- 35 seconds is same as core send version check time
elseif event == 'PLAYER_ENTERING_WORLD' then
lib:DelayedSendVersionCheck()
end
end
......@@ -224,18 +224,13 @@ function lib:SendPluginVersionCheck(message)
return
end
local ChatType, Channel
local ChatType
if IsInRaid() then
ChatType = (not IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInRaid(LE_PARTY_CATEGORY_INSTANCE)) and 'INSTANCE_CHAT' or 'RAID'
elseif IsInGroup() then
ChatType = (not IsInGroup(LE_PARTY_CATEGORY_HOME) and IsInGroup(LE_PARTY_CATEGORY_INSTANCE)) and 'INSTANCE_CHAT' or 'PARTY'
else
local ElvUIGVC = GetChannelName('ElvUIGVC')
if ElvUIGVC and ElvUIGVC > 0 then
ChatType, Channel = 'CHANNEL', ElvUIGVC
elseif IsInGuild() then
ChatType = 'GUILD'
end
elseif IsInGuild() then
ChatType = 'GUILD'
end
if not ChatType then
......@@ -250,14 +245,14 @@ function lib:SendPluginVersionCheck(message)
splitMessage = strmatch(strsub(message, 1, maxChar), '.+;')
if splitMessage then -- incase the string is over 250 but doesnt contain `;`
message = gsub(message, '^'..gsub(splitMessage, '([%(%)%.%%%+%-%*%?%[%^%$])','%%%1'), '')
E:Delay(delay, C_ChatInfo_SendAddonMessage, lib.prefix, splitMessage, ChatType, Channel)
E:Delay(delay, C_ChatInfo_SendAddonMessage, lib.prefix, splitMessage, ChatType)
delay = delay + 1
end
end
E:Delay(delay, lib.ClearSendMessageWait)
else
C_ChatInfo_SendAddonMessage(lib.prefix, message, ChatType, Channel)
C_ChatInfo_SendAddonMessage(lib.prefix, message, ChatType)
lib.ClearSendMessageWait()
end
end
......
......@@ -914,13 +914,8 @@ function E:SendMessage()
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, (not IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInRaid(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "RAID")
elseif IsInGroup() then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, (not IsInGroup(LE_PARTY_CATEGORY_HOME) and IsInGroup(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "PARTY")
else
local ElvUIGVC = GetChannelName('ElvUIGVC')
if ElvUIGVC and ElvUIGVC > 0 then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, "CHANNEL", ElvUIGVC)
elseif IsInGuild() then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, "GUILD")
end
elseif IsInGuild() then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, "GUILD")
end
SendMessageWaiting = nil
......@@ -960,9 +955,9 @@ local function SendRecieve(_, event, prefix, message, _, sender)
end
SendRecieveGroupSize = num
end
elseif event == "LOADING_SCREEN_DISABLED" then
elseif event == "PLAYER_ENTERING_WORLD" then
if not SendMessageWaiting then
SendMessageWaiting = E:Delay(30, E.DelayedElvUIGVC) -- attempt to join channel 30 seconds after event, then 5 seconds after that send message
SendMessageWaiting = E:Delay(10, E.SendMessage)
end
end
end
......@@ -972,23 +967,9 @@ C_ChatInfo.RegisterAddonMessagePrefix('ELVUI_VERSIONCHK')
local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_ADDON")
f:RegisterEvent("GROUP_ROSTER_UPDATE")
f:RegisterEvent("LOADING_SCREEN_DISABLED")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", SendRecieve)
function E:DelayedElvUIGVC()
local ElvUIGVC = GetChannelName('ElvUIGVC')
if not (ElvUIGVC and ElvUIGVC > 0) then
local canAddChannel = ChatFrame_CanAddChannel()
if canAddChannel then
JoinPermanentChannel('ElvUIGVC', nil, nil, true)
end
end
if not SendMessageWaiting then
SendMessageWaiting = E:Delay(5, E.SendMessage) -- this is really 30+5, so 35.
end
end
function E:UpdateAll(ignoreInstall)
if not self.initialized then
C_Timer_After(1, function() E:UpdateAll(ignoreInstall) end)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment