function methods.InternalApplyRobloxFilter(Q,T,j,y)if RunService:IsServer()then local u=Q:GetSpeaker(T)local q=y and Q:GetSpeaker(y)if u==nil then return nil end local m=u:GetPlayer()local H=q and q:GetPlayer()if m==nil then return j end local e=tick()local x=0 while true do local T,y=pcall(function()if H then return Chat:FilterStringAsync(j,m,H)else return Chat:FilterStringForBroadcast(j,m)end end)if T then return y else warn("\069\114\114\111\114 \102\105\108\116\101\114\105\110\103 \109\101\115\115\097\103\101\058",y)end x=x+1 if x>MAX_FILTER_RETRIES or tick()-e>MAX_FILTER_DURATION then Q:InternalNotifyFilterIssue()return nil end local u=FILTER_BACKOFF_INTERVALS[math.min(#FILTER_BACKOFF_INTERVALS,x)]local q=u+(math.random()*2-1)*u task.wait(q)end else if not StudioMessageFilteredCache[j]then StudioMessageFilteredCache[j]=true task.wait(.2)end return j end return nil end

function methods:InternalApplyRobloxFilter(speakerName, message, toSpeakerName) --// USES FFLAG
	if RunService:IsServer() then -- and not RunService:IsStudio()) then
		local fromSpeaker = self:GetSpeaker(speakerName)
		local toSpeaker = toSpeakerName and self:GetSpeaker(toSpeakerName)

		if fromSpeaker == nil then
			return nil
		end

		local fromPlayerObj = fromSpeaker:GetPlayer()
		local toPlayerObj = toSpeaker and toSpeaker:GetPlayer()

		if fromPlayerObj == nil then
			return message
		end

		local filterStartTime = tick()
		local filterRetries = 0
		while true do
			local success, message = pcall(function()
				if toPlayerObj then
					return Chat:FilterStringAsync(message, fromPlayerObj, toPlayerObj)
				else
					return Chat:FilterStringForBroadcast(message, fromPlayerObj)
				end
			end)
			
			if success then
				return message
			else
				warn("Error filtering message:", message)
			end
			filterRetries = filterRetries + 1
			if filterRetries > MAX_FILTER_RETRIES or (tick() - filterStartTime) > MAX_FILTER_DURATION then
				self:InternalNotifyFilterIssue()
				return nil
			end
			local backoffInterval = FILTER_BACKOFF_INTERVALS[math.min(#FILTER_BACKOFF_INTERVALS, filterRetries)]
			-- backoffWait = backoffInterval +/- (0 -> backoffInterval)
			local backoffWait = backoffInterval + ((math.random()*2 - 1) * backoffInterval)
			task.wait(backoffWait)
		end
	else
		--// Simulate filtering latency.
		--// There is only latency the first time the message is filtered, all following calls will be instant.
		if not StudioMessageFilteredCache[message] then
			StudioMessageFilteredCache[message] = true
			task.wait(0.2)
		end
		return message
	end

	return nil
end
