Message info
 
To:buddypress-trac@lists.automattic.com From:buddypress-trac@lists.automattic.com Subject:[buddypress-trac] [BuddyPress][6052] trunk/bp-messages: Show \'Deleted User\' throughout messages component when user has been deleted. Date:Thu, 31 May 2012 23:10:13 +0000 (UTC)
 

Revision
6052
Author
boonebgorges
Date
2012-05-31 23:10:13 +0000 (Thu, 31 May 2012)

Log Message

Show 'Deleted User' throughout messages component when user has been deleted.

Fixes #4227

Modified Paths

Diff

Modified: trunk/bp-messages/bp-messages-classes.php (6051 => 6052)


--- trunk/bp-messages/bp-messages-classes.php	2012-05-31 20:42:53 UTC (rev 6051)
+++ trunk/bp-messages/bp-messages-classes.php	2012-05-31 23:10:13 UTC (rev 6052)
@@ -262,9 +262,16 @@
 
 		$recipient_links = array();
 
-		foreach ( (array) $recipients as $recipient )
-			$recipient_links[] = bp_core_get_userlink( $recipient->user_id );
+		foreach ( (array) $recipients as $recipient ) {
+			$recipient_link = bp_core_get_userlink( $recipient->user_id );
 
+			if ( empty( $recipient_link ) ) {
+				$recipient_link = __( 'Deleted User', 'buddypress' );
+			}
+
+			$recipient_links[] = $recipient_link;
+		}
+
 		return implode( ', ', (array) $recipient_links );
 	}
 

Modified: trunk/bp-messages/bp-messages-template.php (6051 => 6052)


--- trunk/bp-messages/bp-messages-template.php	2012-05-31 20:42:53 UTC (rev 6051)
+++ trunk/bp-messages/bp-messages-template.php	2012-05-31 23:10:13 UTC (rev 6052)
@@ -840,8 +840,15 @@
 			return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count($thread_template->thread->recipients) ) );
 
 		foreach( (array) $thread_template->thread->recipients as $recipient ) {
-			if ( (int) $recipient->user_id !== bp_loggedin_user_id() )
-				$recipient_links[] = bp_core_get_userlink( $recipient->user_id );
+			if ( (int) $recipient->user_id !== bp_loggedin_user_id() ) {
+				$recipient_link = bp_core_get_userlink( $recipient->user_id );
+
+				if ( empty( $recipient_link ) ) {
+					$recipient_link = __( 'Deleted User', 'buddypress' );
+				}
+
+				$recipient_links[] = $recipient_link;
+			}
 		}
 
 		return apply_filters( 'bp_get_the_thread_recipients', implode( ', ', $recipient_links ) );