From 5fe2b587427be73a7bb59c42205e59284b5b043c Mon Sep 17 00:00:00 2001 From: Uga <5999549+uga@users.noreply.github.com> Date: Tue, 4 Aug 2026 07:33:21 +0200 Subject: [PATCH] Expose when a guild member's stored equipment reached us MSG_EQUIPMENT_TRANSFER writes lastUpdate next to the inventory it stores, and has done since the guild comm was written. Nothing has ever read it. That matters more here than anywhere else in DataStore. This data does not refresh on its own: it arrives only when the member, or their main, is online and answers a request, so a copy received months ago sits in the table unchanged and is handed out exactly like one received a second ago. A consumer showing it has no way to tell the two apart, and no way to warn anyone. Adds a reader for it, registered next to GetGuildMemberInventoryItem. Our own characters return nothing, deliberately: they are answered from our own tables, which are written as we play, so there is no timestamp to give. Co-Authored-By: Claude Opus 5 --- DataStore_Inventory/API/GuildComm.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/DataStore_Inventory/API/GuildComm.lua b/DataStore_Inventory/API/GuildComm.lua index ed9ab8a..bf0d7fd 100644 --- a/DataStore_Inventory/API/GuildComm.lua +++ b/DataStore_Inventory/API/GuildComm.lua @@ -139,6 +139,25 @@ local function _GetGuildMemberInventoryItem(guild, member, slotID) end end +--[[ + When the equipment we hold for a guild member reached us. + + It has always been written down - the transfer below sets it - but nothing ever read it, so + a panel filled from a copy received weeks ago looked exactly like one filled a second ago. + That matters here more than anywhere else in the addon: this data does not refresh on its + own. It only arrives when the member, or their main, is online and answers, so a stale copy + can stay stale for months. + + Our own characters are answered from our own tables, which are written as we play, so there + is no timestamp to give and none is wanted. +--]] +local function _GetGuildMemberEquipmentTimestamp(guild, member) + if DataStore:GetCharacter(member) then return end + + local info = GetGuildMemberInfo(guild, member) + return info and info.lastUpdate +end + local function _GetGuildMemberAverageItemLevel(guild, member) local character = GetMemberKey(guild, member) @@ -196,6 +215,7 @@ AddonFactory:OnAddonLoaded(addonName, function() ["DataStore_Inventory_Guilds"] = { GetGuildMemberInventoryItem = _GetGuildMemberInventoryItem, GetGuildMemberAverageItemLevel = _GetGuildMemberAverageItemLevel, + GetGuildMemberEquipmentTimestamp = _GetGuildMemberEquipmentTimestamp, }, }, })