anchor.diff:  			return
   		new_text = sanitizeSQL(new_text)
   		var/edit_text = sanitizeSQL("Edited by [editor_ckey] on [SQLtime()] from<br>[old_text]<br>to<br>[new_text]<hr>")
  -		var/datum/DBQuery/query_edit_message = SSdbcore.NewQuery("UPDATE [format_table_name("messages")] SET text = '[new_text]', lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id]")
  +		var/datum/DBQuery/query_edit_message = SSdbcore.NewQuery("UPDATE [format_table_name("messages")] SET text = '[new_text]', lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id] AND deleted = 0")
   		if(!query_edit_message.warn_execute())
   			return
   		log_admin_private("[key_name(usr)] has edited a [type] [(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_ckey]" : ""] made by [admin_ckey] from [old_text] to [new_text]")
  
positive.code: 				else
  					data += " <a href='?_src_=holder;[HrefToken()];editmessage=[id]'>\[Edit\]</a>"
  				if(editor_ckey)
  <<<<<<< HEAD
  					data += " <font size='2'>Last edit by [editor_ckey] <a href='?_src_=holder;messageedits=[id]'>(Click here to see edit log)</a></font>"
  			data += "<br>[text]<hr style='background:#000000; border:0; height:1px'>"
  =======
  					data += " <font size='2'>Last edit by [editor_ckey] <a href='?_src_=holder;[HrefToken()];messageedits=[id]'>(Click here to see edit log)</a></font>"
  			data += "<br>[text]</p><hr style='background:#000000; border:0; height:1px; [alphatext]'>"
  >>>>>>> 84b1e3d... [s] Adds a security token to all admin hrefs (#29839)
  			switch(type)
  				if("message")
  					messagedata += data
  
negative.code: 		if(notedata)
  			output += "<h4>Notes</h4>"
  			output += notedata
  			if(!linkless)
  				if (agegate)
  					if (skipped) //the first skipped message is still shown so that we can put this link over it.
  						output += " <center><a href='?_src_=holder;showmessageckey=[target_ckey];showall=1' style='position: relative; top: -3em;'>\[Show [skipped] hidden messages\]</center>"
  					else
  						output += " <center><a href='?_src_=holder;showmessageckey=[target_ckey];showall=1'>\[Show All\]</center>"
  
  				else
  					output += " <center><a href='?_src_=holder;showmessageckey=[target_ckey]'>\[Hide Old\]</center>"
  	if(index)
  		var/index_ckey
  		var/search
  