Use ClassicAPI social membership checks

This commit is contained in:
Dusk-92
2026-09-03 20:49:37 +02:00
parent f5fab3be7e
commit ce0e99cb47
+18
View File
@@ -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)