- Home /
Photon chat Filter
Greetings. I create simple photon chat application, with configured of returning filtered messages.
And when i'm send "badWord" to chat, i received "###" message. Otherwise, when i send "sentence with badWord", i'm received "#############" message. The question is - can i able parse result on client, to get badWord instead "###" message?
Hi,
I'm currently not sure if I understand you right but if you want to have 'badWord' ins$$anonymous$$d of '#######' you need to check for bad words locally and replace them before sending the message. This way you don't send any bad words which would be filtered on the server. I guess this is possible by modifying and extending the Photon Chat Api scripts, especially private bool publish$$anonymous$$essage(...)
function from the ChatClient class. However this requires some additional work.
Answer by DemonIg15 · Apr 01, 2017 at 06:58 AM
I figured how it's work - in photon send methods, as example "SendPrivateMessage" you need transfer object, in same way that it written in docs. As example - in documentation hastable format written as
Dictionary msg = new Dictionary(){{"ignoredKeyEg", true}, {"msg", "message with bad words"}};
to make it work you need write ChatClient.SendPrivateMessage(msg);