function methods.InternalSendFilteredMessageWithFilterResult(A,Z,Q)local F=ShallowCopy(Z)local b=F.FilterResult local q=A:GetPlayer()local U=""pcall(function()if F.IsFilterResult then if q then U=b:GetChatForUserAsync(q.UserId)else U=b:GetNonChatStringForBroadcastAsync()end else U=b end end)if#U>0 then F.Message=U F.FilterResult=nil A:InternalSendFilteredMessage(F,Q)end end function methods.InternalSendSystemMessage(A,Z,Q)local F,b=pcall(function()A.eReceivedSystemMessage:Fire(Z,Q)end)if not F and b then print("\069\114\114\111\114 \115\101\110\100\105\110\103 \105\110\116\101\114\110\097\108 \115\121\115\116\101\109 \109\101\115\115\097\103\101\058 "..b)end end function methods.UpdateChannelNameColor(A,Z,Q)A.eChannelNameColorUpdated:Fire(Z,Q)end
--// This method is to be used with the new filter API. This method takes the
--// TextFilterResult objects and converts them into the appropriate string
--// messages for each player.
function methods:InternalSendFilteredMessageWithFilterResult(inMessageObj, channelName)
	local messageObj = ShallowCopy(inMessageObj)

	local oldFilterResult = messageObj.FilterResult
	local player = self:GetPlayer()

	local msg = ""
	pcall(function()
		if messageObj.IsFilterResult then
			if player then
				msg = oldFilterResult:GetChatForUserAsync(player.UserId)
			else
				msg = oldFilterResult:GetNonChatStringForBroadcastAsync()
			end
		else
			msg = oldFilterResult
		end
	end)

	--// Messages of 0 length are the result of two users not being allowed
	--// to chat, or GetChatForUserAsync() failing. In both of these situations,
	--// messages with length of 0 should not be sent.
	if #msg > 0 then
		messageObj.Message = msg
		messageObj.FilterResult = nil
		self:InternalSendFilteredMessage(messageObj, channelName)
	end
end

function methods:InternalSendSystemMessage(messageObj, channelName)
	local success, err = pcall(function()
		self.eReceivedSystemMessage:Fire(messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal system message: " .. err)
	end
end

function methods:UpdateChannelNameColor(channelName, channelNameColor)
	self.eChannelNameColorUpdated:Fire(channelName, channelNameColor)
end
