From 4fe7795f2488a1ebe8317967cb5df74e70028149 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Sat, 28 Mar 2026 15:01:32 +0100 Subject: [PATCH] Branch-aware update notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Master and experiment users no longer cross-notify each other about updates. The version message now includes a branch tag (master or exp) derived from the toc version string at runtime — only players on the same branch trigger the update notification. No config needed, works automatically. --- modules/updatenotify.lua | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/updatenotify.lua b/modules/updatenotify.lua index a88730dd..e901a38a 100644 --- a/modules/updatenotify.lua +++ b/modules/updatenotify.lua @@ -5,17 +5,26 @@ pfUI:RegisterModule("updatenotify", "vanilla:tbc", function () local loginchannels = { "BATTLEGROUND", "RAID", "GUILD" } local groupchannels = { "BATTLEGROUND", "RAID" } + -- Determine branch from toc version string. + -- experiment toc has "9.x.x (experiment version)", master does not. + -- Only notify players on the same branch about updates. + local tocversion = GetAddOnMetadata(pfUI.name, "Version") or "" + local localbranch = strfind(tocversion, "experiment") and "exp" or "master" + local versionmsg = "VERSION:" .. localversion .. ":" .. localbranch + pfUI.updater = CreateFrame("Frame") pfUI.updater:RegisterEvent("CHAT_MSG_ADDON") pfUI.updater:RegisterEvent("PLAYER_ENTERING_WORLD") pfUI.updater:RegisterEvent("PARTY_MEMBERS_CHANGED") pfUI.updater:SetScript("OnEvent", function() if event == "CHAT_MSG_ADDON" and arg1 == "pfUI" then - local v, remoteversion = pfUI.api.strsplit(":", arg2) - local remoteversion = tonumber(remoteversion) - if v == "VERSION" and remoteversion then - if remoteversion > localversion then - pfUI_init.updateavailable = remoteversion + local v, rv, branch = pfUI.api.strsplit(":", arg2) + local rv = tonumber(rv) + -- only process VERSION messages from the same branch + -- messages without a branch tag (old versions) are ignored + if v == "VERSION" and rv and branch == localbranch then + if rv > localversion then + pfUI_init.updateavailable = rv end end end @@ -24,7 +33,7 @@ pfUI:RegisterModule("updatenotify", "vanilla:tbc", function () local groupsize = GetNumRaidMembers() > 0 and GetNumRaidMembers() or GetNumPartyMembers() > 0 and GetNumPartyMembers() or 0 if ( this.group or 0 ) < groupsize then for _, chan in pairs(groupchannels) do - SendAddonMessage("pfUI", "VERSION:" .. localversion, chan) + SendAddonMessage("pfUI", versionmsg, chan) end end this.group = groupsize @@ -39,7 +48,7 @@ pfUI:RegisterModule("updatenotify", "vanilla:tbc", function () end for _, chan in pairs(loginchannels) do - SendAddonMessage("pfUI", "VERSION:" .. localversion, chan) + SendAddonMessage("pfUI", versionmsg, chan) end end end)