From d305f83537acca816f8581f73ebe1cf121e5d0fa Mon Sep 17 00:00:00 2001 From: Casey Raethke Date: Wed, 8 Mar 2023 09:06:57 -0600 Subject: [PATCH] Switch to InitiateReport in Classic --- BadBoy_Classic.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/BadBoy_Classic.lua b/BadBoy_Classic.lua index 275090a..95fa26f 100644 --- a/BadBoy_Classic.lua +++ b/BadBoy_Classic.lua @@ -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 @@ -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