From ce0e99cb4760dd2deab466724d97226268c53c2b Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Thu, 3 Sep 2026 20:49:37 +0200 Subject: [PATCH] Use ClassicAPI social membership checks --- api.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/api.lua b/api.lua index 607d160..12511d3 100644 --- a/api.lua +++ b/api.lua @@ -147,6 +147,10 @@ API.focus = type(_G.FocusUnit) == "function" API.chatidentity = type(_G.GetCurrentChatGUID) == "function" and type(_G.GetPlayerInfoByGUID) == "function" +API.guildmembership = type(_G.UnitIsInMyGuild) == "function" +API.friendmembership = type(_G.C_FriendList) == "table" + and type(_G.C_FriendList.IsFriend) == "function" + API.playercache = type(_G.C_PlayerCache) == "table" and type(_G.C_PlayerCache.GetPlayerInfoByName) == "function" @@ -312,6 +316,20 @@ API.GetCurrentChatGUID = function() end end +API.UnitIsInMyGuild = function(unitOrName) + if API.guildmembership and unitOrName then + return _G.UnitIsInMyGuild(unitOrName) and true or false + end + return false +end + +API.IsFriend = function(nameOrGUID) + if API.friendmembership and nameOrGUID then + return _G.C_FriendList.IsFriend(nameOrGUID) and true or false + end + return false +end + API.GetPlayerInfoByGUID = function(guid) if API.chatidentity and guid then return _G.GetPlayerInfoByGUID(guid)