Hello,
1. is there any function to read the badwordlist?
2. Or can i get the location of config.xml?
Reading Badwordlist
I use Java.
I have a private massage system. A user can have more than one private chat window. If he send a massage, the input text displayed in the message window.
My first idea was, to use the message from the server but i don't get a user id nor the name form the recipient. If he has two open privat chats, i can't display the message in the right window.
My second idea is, to send the badwordlist to client and replace it there.
I have a private massage system. A user can have more than one private chat window. If he send a massage, the input text displayed in the message window.
My first idea was, to use the message from the server but i don't get a user id nor the name form the recipient. If he has two open privat chats, i can't display the message in the right window.
My second idea is, to send the badwordlist to client and replace it there.
My first idea was, to use the message from the server but i don't get a user id nor the name form the recipient. If he has two open privat chats, i can't display the message in the right window.
Sorry I am not following. When you say you don't receive the userId what are you talking about? Server side? Client side?
Also I don't understand the connection with the bad words list, the Bad Words Filter works automatically on each private message being sent.
the SmartFoxEvent client side contains only the sender information.
The chatwindows stored by username.
For example
the sender get the message from input and has no badwordfilter for the own messages. If i use the message form SmartfoxEvent, i can't find the right window, because i have no information about the receiver at senders client. I wish i had the receiver id or name in the sfsevent.
The chatwindows stored by username.
For example
Code: Select all
/**
* get a private chat window.
* @param sender user to talk to
* @return the chat instance
*/
private function getPrivateChat(sender:User):PrivateChat
{
var id:String = sender.getName();
if (_activeChats[id])
{
return PrivateChat(_activeChats[id]);
}
else
{
_depthCounter++;
var pc:PrivateChat = new PrivateChat(_canvas, _depthCounter, sender, this, handleCloseChat);
_activeChats[id] = pc;
return pc;
}
}
Code: Select all
/**
* new chat message handler.
* @param msg message
* @param sender from user
*/
private function handleChatMessage(msg:String, sender:User):Void
{
if (sender.getId() == Main.currentUser.uid) return;
var pc:PrivateChat = getPrivateChat(sender);
pc.newMessage("<b>" + sender.getName() + ":</b>\n" + msg + "\n" );
}
the sender get the message from input and has no badwordfilter for the own messages. If i use the message form SmartfoxEvent, i can't find the right window, because i have no information about the receiver at senders client. I wish i had the receiver id or name in the sfsevent.
I would also like access to the bad words list in a SFS extension.
Works great for usernames, room names and public and private chat... however we also have a few custom communication options which also need to be filtered. These run through a SFS extension already, so I should be able to filter through with the bad words list.
Works great for usernames, room names and public and private chat... however we also have a few custom communication options which also need to be filtered. These run through a SFS extension already, so I should be able to filter through with the bad words list.
As regards the private messages and the relative userId take a look at our SmartMessenger tutorial -> http://www.smartfoxserver.com/docs/docP ... /index.htm
The example addresses exactly the same use case.
In this case you can take a reference to the filter:
and the apply it to other messages:
In this case you return the filtered message with **** (asterisks) instead of bad words, otherwise you can avoid to show the entire message, send a warning and whatnot
hope it helps
The example addresses exactly the same use case.
Works great for usernames, room names and public and private chat... however we also have a few custom communication options which also need to be filtered.
In this case you can take a reference to the filter:
Code: Select all
var filter = Packages.it.gotoandplay.smartfoxserver.lib.BadWordsFilter.getInstance()
and the apply it to other messages:
Code: Select all
if (filter.containsBadWords(theMessage))
theMessage = filter.filterWords(theMessage)
In this case you return the filtered message with **** (asterisks) instead of bad words, otherwise you can avoid to show the entire message, send a warning and whatnot
hope it helps
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 44 guests