Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 12406)
+++ wp-includes/comment.php	(working copy)
@@ -820,7 +820,7 @@
 		return false;
 
 	if (wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0)
-		return wp_trash_comment($comment_id);
+		return wp_set_comment_status($comment_id, 'trash');
 
 	do_action('delete_comment', $comment_id);
 
@@ -849,119 +849,6 @@
 }
 
 /**
- * Moves a comment to the Trash
- *
- * @since 2.9.0
- * @uses do_action() on 'trash_comment' before trashing
- * @uses do_action() on 'trashed_comment' after trashing
- *
- * @param int $comment_id Comment ID.
- * @return mixed False on failure
- */
-function wp_trash_comment($comment_id) {
-	if ( EMPTY_TRASH_DAYS == 0 )
-		return wp_delete_comment($comment_id);
-
-	if ( !$comment = get_comment($comment_id) )
-		return false;
-
-	do_action('trash_comment', $comment_id);
-
-	if ( wp_set_comment_status($comment_id, 'trash') ) {
-		add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
-		add_comment_meta($comment_id, '_wp_trash_meta_time', time() );
-		do_action('trashed_comment', $comment_id);
-		return true;
-	}
-
-	return false;
-}
-
-/**
- * Removes a comment from the Trash
- *
- * @since 2.9.0
- * @uses do_action() on 'untrash_comment' before untrashing
- * @uses do_action() on 'untrashed_comment' after untrashing
- *
- * @param int $comment_id Comment ID.
- * @return mixed False on failure
- */
-function wp_untrash_comment($comment_id) {
-	if ( ! (int)$comment_id )
-		return false;
-
-	do_action('untrash_comment', $comment_id);
-
-	$status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
-	if ( empty($status) )
-		$status = '0';
-
-	if ( wp_set_comment_status($comment_id, $status) ) {
-		delete_comment_meta($comment_id, '_wp_trash_meta_time');
-		delete_comment_meta($comment_id, '_wp_trash_meta_status');
-		do_action('untrashed_comment', $comment_id);
-		return true;
-	}
-
-	return false;
-}
-
-/**
- * Marks a comment as Spam
- *
- * @since 2.9.0
- * @uses do_action() on 'spam_comment' before spamming
- * @uses do_action() on 'spammed_comment' after spamming
- *
- * @param int $comment_id Comment ID.
- * @return mixed False on failure
- */
-function wp_spam_comment($comment_id) {
-	if ( !$comment = get_comment($comment_id) )
-		return false;
-
-	do_action('spam_comment', $comment_id);
-
-	if ( wp_set_comment_status($comment_id, 'spam') ) {
-		add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
-		do_action('spammed_comment', $comment_id);
-		return true;
-	}
-
-	return false;
-}
-
-/**
- * Removes a comment from the Spam
- *
- * @since 2.9.0
- * @uses do_action() on 'unspam_comment' before unspamming
- * @uses do_action() on 'unspammed_comment' after unspamming
- *
- * @param int $comment_id Comment ID.
- * @return mixed False on failure
- */
-function wp_unspam_comment($comment_id) {
-	if ( ! (int)$comment_id )
-		return false;
-
-	do_action('unspam_comment', $comment_id);
-
-	$status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
-	if ( empty($status) )
-		$status = '0';
-
-	if ( wp_set_comment_status($comment_id, $status) ) {
-		delete_comment_meta($comment_id, '_wp_trash_meta_status');
-		do_action('unspammed_comment', $comment_id);
-		return true;
-	}
-
-	return false;
-}
-
-/**
  * The status of a comment by ID.
  *
  * @since 1.0.0
@@ -1237,6 +1124,9 @@
 function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
 	global $wpdb;
 
+	if ( $comment_status == 'trash' && EMPTY_TRASH_DAYS == 0 )
+		return wp_delete_comment($comment_id);
+
 	$status = '0';
 	switch ( $comment_status ) {
 		case 'hold':
@@ -1252,16 +1142,26 @@
 			}
 			break;
 		case 'spam':
-			$status = 'spam';
-			break;
 		case 'trash':
-			$status = 'trash';
+			$status = $comment_status;
 			break;
+		case 'unspam':
+		case 'untrash':
+			$status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
+			if ( empty($status) )
+				$status = '0';
+			break;
 		default:
 			return false;
 	}
-
+	
 	$comment_old = wp_clone(get_comment($comment_id));
+	$old_status = $comment_old->comment_approved;
+	
+	if ( !in_array( $status, array('trash','spam') ) && in_array( $old_status, array('trash','spam') ) ) {
+		delete_comment_meta($comment_id, '_wp_trash_meta_time');
+		delete_comment_meta($comment_id, '_wp_trash_meta_status');
+	}
 
 	if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) {
 		if ( $wp_error )
@@ -1269,6 +1169,11 @@
 		else
 			return false;
 	}
+	
+	if ( in_array( $status, array('trash','spam') ) ) {
+		add_comment_meta($comment_id, '_wp_trash_meta_status', $old_status);
+		add_comment_meta($comment_id, '_wp_trash_meta_time', time() );
+	}
 
 	clean_comment_cache($comment_id);
 
Index: wp-admin/edit-comments.php
===================================================================
--- wp-admin/edit-comments.php	(revision 12406)
+++ wp-admin/edit-comments.php	(working copy)
@@ -53,19 +53,19 @@
 				$unapproved++;
 				break;
 			case 'spam' :
-				wp_spam_comment($comment_id);
+				wp_set_comment_status($comment_id, 'spam');
 				$spammed++;
 				break;
 			case 'unspam' :
-				wp_unspam_comment($comment_id);
+				wp_set_comment_status($comment_id, 'unspam');
 				$unspammed++;
 				break;
 			case 'trash' :
-				wp_trash_comment($comment_id);
+				wp_set_comment_status($comment_id, 'trash');
 				$trashed++;
 				break;
 			case 'untrash' :
-				wp_untrash_comment($comment_id);
+				wp_set_comment_status($comment_id, 'untrash');
 				$untrashed++;
 				break;
 			case 'delete' :
Index: wp-admin/admin-ajax.php
===================================================================
--- wp-admin/admin-ajax.php	(revision 12406)
+++ wp-admin/admin-ajax.php	(working copy)
@@ -214,19 +214,19 @@
 	if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
 		if ( 'trash' == $status )
 			die( (string) time() );
-		$r = wp_trash_comment( $comment->comment_ID );
+		$r = wp_set_comment_status( $comment->comment_ID, 'trash' );
 	} elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) {
 		if ( 'trash' != $status )
 			die( (string) time() );
-		$r = wp_untrash_comment( $comment->comment_ID );
+		$r = wp_set_comment_status( $comment->comment_ID, 'untrash' );
 	} elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
 		if ( 'spam' == $status )
 			die( (string) time() );
-		$r = wp_spam_comment( $comment->comment_ID );
+		$r = wp_set_comment_status( $comment->comment_ID, 'spam' );
 	} elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) {
 		if ( 'spam' != $status )
 			die( (string) time() );
-		$r = wp_unspam_comment( $comment->comment_ID );
+		$r = wp_set_comment_status( $comment->comment_ID, 'unspam' );
 	} elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
 		$r = wp_delete_comment( $comment->comment_ID );
 	} else {
Index: wp-admin/comment.php
===================================================================
--- wp-admin/comment.php	(revision 12406)
+++ wp-admin/comment.php	(working copy)
@@ -185,19 +185,19 @@
 			$redir = add_query_arg( array('deleted' => '1'), $redir );
 			break;
 		case 'trashcomment' :
-			wp_trash_comment($comment_id);
+			wp_set_comment_status( $comment_id, 'trash' );
 			$redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir );
 			break;
 		case 'untrashcomment' :
-			wp_untrash_comment($comment_id);
+			wp_set_comment_status( $comment_id, 'untrash' );
 			$redir = add_query_arg( array('untrashed' => '1'), $redir );
 			break;
 		case 'spamcomment' :
-			wp_spam_comment($comment_id);
+			wp_set_comment_status( $comment_id, 'spam' );
 			$redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir );
 			break;
 		case 'unspamcomment' :
-			wp_unspam_comment($comment_id);
+			wp_set_comment_status( $comment_id, 'unspam' );
 			$redir = add_query_arg( array('unspammed' => '1'), $redir );
 			break;
 	}
