Index: includes/Article.php
===================================================================
--- includes/Article.php	(revision 35071)
+++ includes/Article.php	(working copy)
@@ -2278,6 +2278,14 @@
 		$ns = $this->mTitle->getNamespace();
 		$t = $this->mTitle->getDBkey();
 		$id = $this->mTitle->getArticleID();
+		if ( $ns == NS_USER_TALK ) {
+			if ( !User::isIP( $this->mTitle->getText() ) ) {
+				$userid = User::idFromName ( $this->mTitle->getText() );
+			}
+			else {
+				$userid = $this->mTitle->getText();
+			}
+		}
 
 		if ( $t == '' || $id == 0 ) {
 			return false;
@@ -2333,7 +2341,17 @@
 
 		# Delete restrictions for it
 		$dbw->delete( 'page_restrictions', array ( 'pr_page' => $id ), __METHOD__ );
-
+		
+		# Cleanup any lingering user_talk "You have new messages" flags
+		if ( $userid ) {
+			if ( !User::isIP( $userid ) ) {
+				$dbw->delete( 'user_newtalk', array ( 'user_id' => $userid ), __METHOD__ );
+			}
+			else {
+				$dbw->delete( 'user_newtalk', array ( 'user_ip' => $userid ), __METHOD__ );
+			}
+		}
+		
 		# Fix category table counts
 		$cats = array();
 		$res = $dbw->select( 'categorylinks', 'cl_to',
@@ -2380,7 +2398,7 @@
 
 		# Clear caches
 		Article::onArticleDelete( $this->mTitle );
-
+		
 		# Clear the cached article id so the interface doesn't act like we exist
 		$this->mTitle->resetArticleID( 0 );
 		$this->mTitle->mArticleID = 0;
