Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to InitiateReport in Classic #162

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions BadBoy_Classic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ local repTbl = {

--[[ Chat Scanning ]]--
local Ambiguate, BNGetGameAccountInfoByGUID, strfind, gsub, lower, next, type, tremove = Ambiguate, BNGetGameAccountInfoByGUID, string.find, string.gsub, string.lower, next, type, tremove
local IsFriend, IsGuildMember, UnitInRaid, UnitInParty, SetCVar, GetCVarBool = C_FriendList.IsFriend, IsGuildMember, UnitInRaid, UnitInParty, C_CVar.SetCVar, C_CVar.GetCVarBool
local CanReportPlayer, ReportPlayer, PlayerLocation = C_ChatInfo.CanReportPlayer, C_ChatInfo.ReportPlayer, PlayerLocation
local IsFriend, IsGuildMember, UnitInRaid, UnitInParty, SetCVar, GetCVarBool, GetName = C_FriendList.IsFriend, IsGuildMember, UnitInRaid, UnitInParty, C_CVar.SetCVar, C_CVar.GetCVarBool, C_PlayerInfo.GetName
local CanReportPlayer, ReportInfo, ReportFrame, PlayerLocation = C_ChatInfo.CanReportPlayer, ReportInfo, ReportFrame, PlayerLocation
local spamCollector, spamLogger, prevShow, enableBubble = {}, {}, 0, false
local blockedLineId, et, chatLines, chatPlayers = 0, 7, {}, {}
local btn, reportFrame
Expand Down Expand Up @@ -273,7 +273,15 @@ do
local go, pass = xpcall(CanReportPlayer, dummy, v)
if go and pass then
BADBOY_BLACKLIST[k] = true
ReportPlayer("spam", v)
local reportInfo = ReportInfo:CreateReportInfoFromType(Enum.ReportType.Chat)
reportInfo:SetReportMajorCategory(Enum.ReportMajorCategory.InappropriateCommunication)
reportInfo:SetComment("Spammer blocked by BadBoy")

ReportFrame:SetMajorType(Enum.ReportMajorCategory.InappropriateCommunication);
ReportFrame:SetMinorCategoryFlag(Enum.ReportMinorCategory.Spam, true);

local playerName = GetName(v)
ReportFrame:InitiateReport(reportInfo, playerName, v, false, true)
end
spamCollector[k] = nil
spamLogger[k] = nil
Expand Down