From d34a8331a5ff940757e92bd2121105420cbaca04 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sat, 6 Jun 2020 14:13:55 +0300 Subject: [PATCH] correct CHAT_MSG_WHISPER filter function for transmission --- WeakAuras/Transmission.lua | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/WeakAuras/Transmission.lua b/WeakAuras/Transmission.lua index 684a034..cdad4e8 100644 --- a/WeakAuras/Transmission.lua +++ b/WeakAuras/Transmission.lua @@ -170,21 +170,11 @@ local function filterFunc(_, event, msg, player, l, cs, t, flag, channelId, ...) if event == "CHAT_MSG_WHISPER" and not UnitInRaid(player) and not UnitInParty(player) then -- XXX: Need a guild check local _, num = BNGetNumFriends() for i=1, num do - if C_BattleNet then -- introduced in 8.2.5 PTR - local toon = C_BattleNet.GetFriendNumGameAccounts(i) - for j=1, toon do - local gameAccountInfo = C_BattleNet.GetFriendGameAccountInfo(i, j); - if gameAccountInfo.characterName == player and gameAccountInfo.clientProgram == "WoW" then - return false, newMsg, player, l, cs, t, flag, channelId, ...; -- Player is a real id friend, allow it - end - end - else -- keep old method for 8.2 and Classic - local toon = BNGetNumFriendGameAccounts(i) - for j=1, toon do - local _, rName, rGame = BNGetFriendGameAccountInfo(i, j) - if rName == player and rGame == "WoW" then - return false, newMsg, player, l, cs, t, flag, channelId, ...; -- Player is a real id friend, allow it - end + local toon = BNGetNumFriendToons(i) + for j=1, toon do + local _, rName, rGame = BNGetFriendToonInfo(i, j) + if rName == trimmedPlayer and rGame == "WoW" then + return false, newMsg, player, l, cs, t, flag, channelId, ...; -- Player is a real id friend, allow it end end end