Skip to content

Commit 544139b

Browse files
Better (worse?) handling of Battle.net IDs. All Battle.net whispers are now displayed with [id: <some id>] instead of their corresponding real names. This "resolves" the issue where real names are not consistent between logins, which would attribute some messages to the wrong people in Elephant before this update. Instead, they will be attributed to the internal ID decided by the WoW client when the message is received or sent. This stays consistent within a single gaming session, but changes when you logoff/log back in. So the same ID might be reused for a different person later on.
Nothing can be done about this inconsistency from an addon. Using IDs is the closest I can be. This is due to privacy reasons and unfortunately is out of my control.
1 parent a37478f commit 544139b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Locales/Locale-enUS.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ L['monstersay'] = "%s says"
134134
L['monsteryell'] = "%s yells"
135135
L['whisperfrom'] = "%s whispers"
136136
L['whisperto'] = "To %s"
137+
L['id'] = "id"
137138

138139
--[[ Addon messages ]]
139140
L['clearallconfirm'] = "All chats cleared."

Message.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ local function GetSenderWithClassColor(sender, classColor, withLink)
2525
end
2626
end
2727

28+
local function GetBattleNetId(sender)
29+
return string.sub(sender, 3, -3)
30+
end
31+
2832
--[[
2933
Creates a hex color string from the given decimal
3034
red, green, blue and alpha values.
@@ -84,7 +88,16 @@ function Elephant:GetLiteralMessage(mStruct, useTimestamps)
8488
elseif mStruct['type'] == "MONSTER_WHISPER" then
8589
msg = msg .. mStruct['arg2']
8690
else
87-
local pLink = GetSenderWithClassColor(mStruct['arg2'], mStruct['clColor'], true)
91+
local withLink = true
92+
local sender = mStruct['arg2']
93+
94+
if mStruct['type'] == "BN_WHISPER_INFORM" or mStruct['type'] == "BN_WHISPER" then
95+
-- We can't track Battle.net names due to privacy reasons, so we remove links and name resolution.
96+
withLink = false
97+
sender = "[" .. Elephant.L['id'] .. ": " .. GetBattleNetId(mStruct['arg2']) .. "]"
98+
end
99+
100+
local pLink = GetSenderWithClassColor(sender, mStruct['clColor'], withLink)
88101

89102
if mStruct['type'] == "WHISPER_INFORM" or mStruct['type'] == "BN_WHISPER_INFORM" then
90103
msg = msg .. format(Elephant.L['whisperto'], pLink)

0 commit comments

Comments
 (0)