Skip to content

Commit

Permalink
fix: do not concat if icon is not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
fang2hou committed Aug 28, 2024
1 parent 13ab3b7 commit 830bb14
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Modules/Social/ChatText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2091,10 +2091,13 @@ function CT:ElvUIChat_AchievementMessageHandler(event, frame, achievementMessage
local coloredName = F.CreateClassColorString(displayName, playerInfo.englishClass)
local classIcon = self.db.classIcon
and F.GetClassIconStringWithStyle(playerInfo.englishClass, self.db.classIconStyle, 16, 16)
classIcon = classIcon and classIcon .. " " or ""

if coloredName and classIcon and cache[achievementID] then
local playerName = format("|Hplayer:%s|h%s %s|h", playerInfo.nameWithRealm, classIcon, coloredName)
if classIcon then
coloredName = classIcon .. " " .. coloredName
end

if coloredName and cache[achievementID] then
local playerName = format("|Hplayer:%s|h%s|h", playerInfo.nameWithRealm, coloredName)
cache[achievementID][playerName] = true
return true
end
Expand Down Expand Up @@ -2155,15 +2158,15 @@ end
function CT:BetterSystemMessage()
if self.db and self.db.guildMemberStatus and not self.isSystemMessageHandled then
local setHyperlink = _G.ItemRefTooltip.SetHyperlink
function _G.ItemRefTooltip:SetHyperlink(data, ...)
function _G.ItemRefTooltip.SetHyperlink(tt, data, ...)
if strsub(data, 1, 8) == "wtinvite" then
local player = strmatch(data, "wtinvite:(.+)")
if player then
C_PartyInfo_InviteUnit(player)
return
end
end
setHyperlink(self, data, ...)
setHyperlink(tt, data, ...)
end
self.isSystemMessageHandled = true
end
Expand Down

0 comments on commit 830bb14

Please sign in to comment.