title: Simple techniques for preventing spamming of a web chat application
body: <p>I have a simple, custom rolled chat here: ( <a href="http://ninjawars.net" rel="nofollow">http://ninjawars.net</a> - essentially: ajax chat, php backend, javascript listing of chat messages, logged-in user input only ) that suffers from being able to be spammed.  What are some simple systems to prevent spamming of a chat?</p>
  
  <p>One thing (lowest level of protection) that I have already implemented:  </p>
  
  <ul>
  <li>Ignore consecutive duplicate messages from the same user.</li>
  </ul>
  
  <p>Other ideas that I have:</p>
  
  <ul>
  <li>Add consecutive messages from the same user together, instead of creating a separate message line. (relatively simple to implement, decreases the effect of spam but doesn't prevent it)</li>
  <li>Prevent continued messages after a certain number of consecutive messages from one user, for new users. (relatively simple to implement)</li>
  <li>Chat moderation by trusted users (complex to implement).</li>
  </ul>
  
  <p>Are there any simple systems/algorithms to prevent chat message spamming that I should know about?</p>