A chat client spam filter for C#

RampagePS

Member
Joined
Aug 25, 2004
Messages
17
Hey I am making a multiple connection chat client and I wanted to know if anyone of yall knew of a good tutorial for makeing a spam filter.
 
Last edited by a moderator:
Im making a little chat program right now, I havent gotten to the spam part yet, but Im pretty sure Ill be using Regular Expressions.
 
Diesel said:
Im making a little chat program right now, I havent gotten to the spam part yet, but Im pretty sure Ill be using Regular Expressions.

A very *simple* solution would be to add a counting variable on the client end. For instance if they send 10 messages in less than 2 seconds its probably spam. Another thing you could do is have a history (again keeping it simple). Check to see if the last thing they sent is equal to the current one sent. If it is, they sent the same thing twice... Those are again simple methods. The use of both in an app would kill scrollers and spammers... but would be easy to overcome (for people bent on spamming).
 
RampagePS said:
Hey thanks man, so with the counting variable how would it tell if they were spamming.


Everytime a message is sent out from the client, you could add 1 to the variable and call a function. Say you put a limit of 10 messages per 4 seconds, the function would check the variable and then decide whether 10 have been sent in the 4 seconds. If it has then the function could return true, if not, false. To reset the variable, have timer set to execute every 4 seconds and write the variable back to 0.

Note: This is not a sure fire way of checking for spam, but is down cut down on it by alot. Again if you didnt want to get complicated, use a history and a counter to have a very simple filter. Since both are put client side, it also creates less stress on the server.
 
Back
Top