How to properly handle editing/deleting chat messages?

I'm deciding how to handle deleting and editing messages in a web chat app. For now, I can think of a few things I need feedback on.

  1. Deleting/Editing should have a time limit - maybe like SE, 5 minutes. Enough time for the user to realize a mistake, not enough to abuse it. I'm already kind of set on this, but feedback is always welcome.
  2. Delete the message, or 'hide' it, but still have it stored in the database? This may be more of a 'popular' site issue, this is just a little project I'm working on.
  3. I already want to keep an edit history, but should it be publicly available (like in facebook)? Or visible just to the message owner?
  4. Should there be a undo button - how to display it?

If you have any other ideas what I should look out for, please tell. This is my first time designing something that needs natural user interaction. :)