function methods.InternalSendFilteredMessageWithFilterResult(d,J,k)local n=ShallowCopy(J)local A=n.FilterResult local Q=d:GetPlayer()local u=""pcall(function()if n.IsFilterResult then if Q then u=A:GetChatForUserAsync(Q.UserId)else u=A:GetNonChatStringForBroadcastAsync()end else u=A end end)if#u>0 then n.Message=u n.FilterResult=nil d:InternalSendFilteredMessage(n,k)end end function methods.InternalSendSystemMessage(d,J,k)local n,A=pcall(function()d.eReceivedSystemMessage:Fire(J,k)end)if not n and A 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 "..A)end end function methods.UpdateChannelNameColor(d,J,k)d.eChannelNameColorUpdated:Fire(J,k)end

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
