Skip to content

Commit

Permalink
Merge branch 'main' into ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Dec 1, 2024
2 parents 7f691a3 + 886d8fe commit 41b601b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ElvUI/Core/Modules/Chat/Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1651,24 +1651,24 @@ end

function CH:GetBNFriendColor(name, id, useBTag)
local info = C_BattleNet_GetAccountInfoByID(id)
local BATTLE_TAG = info.battleTag and strmatch(info.battleTag,'([^#]+)')
local TAG = (useBTag or CH.db.useBTagName) and BATTLE_TAG
local BNET_TAG = info and info.isBattleTagFriend and info.battleTag and strmatch(info.battleTag,'([^#]+)')
local TAG = (useBTag or CH.db.useBTagName) and BNET_TAG

local Class
local gameInfo = info.gameAccountID and C_BattleNet_GetGameAccountInfoByID(info.gameAccountID)
local gameInfo = info and info.gameAccountID and C_BattleNet_GetGameAccountInfoByID(info.gameAccountID)
if gameInfo and gameInfo.className then
Class = E:UnlocalizedClassName(gameInfo.className)
else
local firstToonClass = CH:GetBNFirstToonClassColor(id)
if firstToonClass then
Class = E:UnlocalizedClassName(firstToonClass)
else
return TAG or name, info.isBattleTagFriend and BATTLE_TAG
return TAG or name, BNET_TAG
end
end

local Color = Class and E:ClassColor(Class)
return (Color and format('|c%s%s|r', Color.colorStr, TAG or name)) or TAG or name, info.isBattleTagFriend and BATTLE_TAG
return (Color and format('|c%s%s|r', Color.colorStr, TAG or name)) or TAG or name, BNET_TAG
end

local PluginIconsCalls = {}
Expand Down Expand Up @@ -2219,7 +2219,7 @@ function CH:ChatFrame_MessageEventHandler(frame, event, arg1, arg2, arg3, arg4,
message = format(globalstring, arg2)
elseif arg1 == 'FRIEND_ONLINE' or arg1 == 'FRIEND_OFFLINE' then
local accountInfo = C_BattleNet_GetAccountInfoByID(arg13)
local gameInfo = accountInfo.gameAccountInfo
local gameInfo = accountInfo and accountInfo.gameAccountInfo
if gameInfo and gameInfo.clientProgram and gameInfo.clientProgram ~= '' then
if GetTitleIconTexture then
GetTitleIconTexture(gameInfo.clientProgram, TitleIconVersion_Small, function(success, texture)
Expand Down

0 comments on commit 41b601b

Please sign in to comment.