Skip to content

Commit

Permalink
Merge pull request #161 from arog85/1.7.13
Browse files Browse the repository at this point in the history
Reverted previous filter with fix to friend online spam still occurring
  • Loading branch information
kakysha authored Dec 11, 2021
2 parents ed2b06c + c21bb60 commit 28adf51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
25 changes: 3 additions & 22 deletions honorspy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,6 @@ function HonorSpy:PLAYER_DEAD()
end
end

local ERR_FRIEND_ONLINE_PATTERN = "";

if (som_realm) then
ERR_FRIEND_ONLINE_PATTERN = ERR_FRIEND_ONLINE_SS:gsub("%%s", "(.+)"):gsub("([%[%]])", "%%%1")
else
ERR_FRIEND_ONLINE_PATTERN = ""
end

function FAKE_PLAYERS_FILTER(_s, e, msg, ...)
-- not found, fake
if (msg == ERR_FRIEND_NOT_FOUND) then
Expand All @@ -518,25 +510,16 @@ function FAKE_PLAYERS_FILTER(_s, e, msg, ...)
if (not friend) then
friend = msg:match(string.gsub(ERR_FRIEND_ALREADY_S, "(%%s)", "(.+)"))
end

if (friend) then
HonorSpy.db.factionrealm.goodPlayers[friend] = true
HonorSpy.db.factionrealm.fakePlayers[friend] = nil
if (friend == nameToTest) then
HonorSpy:removeTestedFriends()
nameToTest = nil
-- nameToTest = nil --This was the cause of the online spam
end
return true
end

if (som_realm) then
local friend = msg:match(ERR_FRIEND_ONLINE_PATTERN)
if (friend) then
local match = friend and friend == nameToTest
UnmuteSoundFile(567518)
nameToTest = nil
return match
end
end
end

function HonorSpy:removeTestedFriends()
Expand All @@ -562,9 +545,7 @@ function HonorSpy:TestNextFakePlayer()
end
end
if (nameToTest) then
if (som_realm) then
MuteSoundFile(567518)
end
-- MuteSoundFile(567518)
C_FriendList.AddFriend(nameToTest, "HonorSpy testing")
HS_wait(1, function() HonorSpy:TestNextFakePlayer() end)
end
Expand Down
2 changes: 1 addition & 1 deletion honorspy.toc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Author: kakysha
## OptionalDeps: Ace3
## Version: 1.7.12
## Version: 1.7.13

## X-Category: Battlegrounds/PvP
## SavedVariables: HonorSpyDB
Expand Down

0 comments on commit 28adf51

Please sign in to comment.