<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][8791] trunk/src/bp-messages/bp-messages-template.php: Code clean-up in `bp-messages-template.php`.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/8791">8791</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2014-08-11 16:56:19 +0000 (Mon, 11 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Code clean-up in `bp-messages-template.php`.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpmessagesbpmessagestemplatephp">trunk/src/bp-messages/bp-messages-template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpmessagesbpmessagestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/bp-messages/bp-messages-template.php (8790 => 8791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/bp-messages/bp-messages-template.php   2014-08-11 16:37:42 UTC (rev 8790)
+++ trunk/src/bp-messages/bp-messages-template.php      2014-08-11 16:56:19 UTC (rev 8791)
</span><span class="lines">@@ -192,8 +192,9 @@
</span><span class="cx">   * @return bool True if there are items in the loop, otherwise false.
</span><span class="cx">   */
</span><span class="cx">  function has_threads() {
</span><del>-               if ( $this->thread_count )
</del><ins>+                if ( $this->thread_count ) {
</ins><span class="cx">                   return true;
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return false;
</span><span class="cx">  }
</span><span class="lines">@@ -540,8 +541,8 @@
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><span class="cx">  function bp_get_message_thread_delete_link() {
</span><del>-               global $messages_template, $bp;
-               return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/' . bp_current_action() . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) );
</del><ins>+                global $messages_template;
+               return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -560,8 +561,9 @@
</span><span class="cx"> 
</span><span class="cx">          $class = false;
</span><span class="cx"> 
</span><del>-               if ( $messages_template->current_thread % 2 == 1 )
</del><ins>+                if ( $messages_template->current_thread % 2 == 1 ) {
</ins><span class="cx">                   $class .= 'alt';
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return apply_filters( 'bp_get_message_css_class', trim( $class ) );
</span><span class="cx">  }
</span><span class="lines">@@ -574,10 +576,11 @@
</span><span class="cx"> function bp_message_thread_has_unread() {
</span><span class="cx">  global $messages_template;
</span><span class="cx"> 
</span><del>-       if ( $messages_template->thread->unread_count )
-               return true;
</del><ins>+        $retval = ! empty( $messages_template->thread->unread_count )
+               ? true
+               : false;
</ins><span class="cx"> 
</span><del>-       return false;
</del><ins>+        return apply_filters( 'bp_message_thread_has_unread', $retval );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -594,10 +597,11 @@
</span><span class="cx">  function bp_get_message_thread_unread_count() {
</span><span class="cx">          global $messages_template;
</span><span class="cx"> 
</span><del>-               if ( (int) $messages_template->thread->unread_count )
-                       return apply_filters( 'bp_get_message_thread_unread_count', $messages_template->thread->unread_count );
</del><ins>+                $count = ! empty( $messages_template->thread->unread_count )
+                       ? (int) $messages_template->thread->unread_count
+                       : false;
</ins><span class="cx"> 
</span><del>-               return false;
</del><ins>+                return apply_filters( 'bp_get_message_thread_unread_count', $count );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -712,9 +716,9 @@
</span><span class="cx">  global $messages_template;
</span><span class="cx"> 
</span><span class="cx">  $start_num = intval( ( $messages_template->pag_page - 1 ) * $messages_template->pag_num ) + 1;
</span><del>-       $from_num = bp_core_number_format( $start_num );
-       $to_num = bp_core_number_format( ( $start_num + ( $messages_template->pag_num - 1 ) > $messages_template->total_thread_count ) ? $messages_template->total_thread_count : $start_num + ( $messages_template->pag_num - 1 ) );
-       $total = bp_core_number_format( $messages_template->total_thread_count );
</del><ins>+        $from_num  = bp_core_number_format( $start_num );
+       $to_num    = bp_core_number_format( ( $start_num + ( $messages_template->pag_num - 1 ) > $messages_template->total_thread_count ) ? $messages_template->total_thread_count : $start_num + ( $messages_template->pag_num - 1 ) );
+       $total     = bp_core_number_format( $messages_template->total_thread_count );
</ins><span class="cx"> 
</span><span class="cx">  echo sprintf( _n( 'Viewing 1 message', 'Viewing %1$s - %2$s of %3$s messages', $total, 'buddypress' ), $from_num, $to_num, number_format_i18n( $total ) );
</span><span class="cx"> }
</span><span class="lines">@@ -786,9 +790,9 @@
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><span class="cx">  function bp_get_messages_subject_value() {
</span><del>-               $subject = '';
-               if ( !empty( $_POST['subject'] ) )
-                       $subject = $_POST['subject'];
</del><ins>+                $subject = ! empty( $_POST['subject'] )
+                       ? $_POST['subject']
+                       : '';
</ins><span class="cx"> 
</span><span class="cx">          return apply_filters( 'bp_get_messages_subject_value', $subject );
</span><span class="cx">  }
</span><span class="lines">@@ -808,10 +812,11 @@
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><span class="cx">  function bp_get_messages_content_value() {
</span><del>-               $content = '';
-               if ( !empty( $_POST['content'] ) )
-                       $content = $_POST['content'];
</del><span class="cx"> 
</span><ins>+               $content = !empty( $_POST['content'] )
+                       ? $_POST['content']
+                       : '';
+
</ins><span class="cx">           return apply_filters( 'bp_get_messages_content_value', $content );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -850,10 +855,11 @@
</span><span class="cx"> function bp_messages_is_active_notice() {
</span><span class="cx">  global $messages_template;
</span><span class="cx"> 
</span><del>-       if ( $messages_template->thread->is_active )
-               return true;
</del><ins>+        $retval = ! empty( $messages_template->thread->is_active )
+               ? true
+               : false;
</ins><span class="cx"> 
</span><del>-       return false;
</del><ins>+        return apply_filters( 'bp_messages_is_active_notice', $retval );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -880,9 +886,9 @@
</span><span class="cx">   */
</span><span class="cx">  function bp_get_message_is_active_notice() {
</span><span class="cx"> 
</span><del>-               $string = '';
-               if ( bp_messages_is_active_notice() )
-                       $string = __( 'Currently Active', 'buddypress' );
</del><ins>+                $string = bp_messages_is_active_notice()
+                       ? __( 'Currently Active', 'buddypress' )
+                       : '';
</ins><span class="cx"> 
</span><span class="cx">          return apply_filters( 'bp_get_message_is_active_notice', $string );
</span><span class="cx">  }
</span><span class="lines">@@ -916,7 +922,7 @@
</span><span class="cx">   */
</span><span class="cx">  function bp_get_message_notice_post_date() {
</span><span class="cx">          global $messages_template;
</span><del>-               return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime($messages_template->thread->date_sent) ) );
</del><ins>+                return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime( $messages_template->thread->date_sent ) ) );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -963,9 +969,9 @@
</span><span class="cx">   * @return string Delete URL.
</span><span class="cx">   */
</span><span class="cx">  function bp_get_message_notice_delete_link() {
</span><del>-               global $messages_template, $bp;
</del><ins>+                global $messages_template;
</ins><span class="cx"> 
</span><del>-               return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( bp_loggedin_user_domain() . $bp->messages->slug . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) );
</del><ins>+                return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -980,12 +986,12 @@
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><span class="cx">  function bp_get_message_activate_deactivate_link() {
</span><del>-               global $messages_template, $bp;
</del><ins>+                global $messages_template;
</ins><span class="cx"> 
</span><del>-               if ( 1 == (int) $messages_template->thread->is_active ) {
-                       $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id ), 'messages_deactivate_notice' );
</del><ins>+                if ( 1 === (int) $messages_template->thread->is_active ) {
+                       $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/deactivate/' . $messages_template->thread->id ), 'messages_deactivate_notice' );
</ins><span class="cx">           } else {
</span><del>-                       $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id ), 'messages_activate_notice' );
</del><ins>+                        $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/activate/' . $messages_template->thread->id ), 'messages_activate_notice' );
</ins><span class="cx">           }
</span><span class="cx">          return apply_filters( 'bp_get_message_activate_deactivate_link', $link );
</span><span class="cx">  }
</span><span class="lines">@@ -1004,7 +1010,7 @@
</span><span class="cx">  function bp_get_message_activate_deactivate_text() {
</span><span class="cx">          global $messages_template;
</span><span class="cx"> 
</span><del>-               if ( 1 == (int) $messages_template->thread->is_active  ) {
</del><ins>+                if ( 1 === (int) $messages_template->thread->is_active  ) {
</ins><span class="cx">                   $text = __('Deactivate', 'buddypress');
</span><span class="cx">          } else {
</span><span class="cx">                  $text = __('Activate', 'buddypress');
</span><span class="lines">@@ -1030,8 +1036,7 @@
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><span class="cx">  function bp_get_messages_slug() {
</span><del>-               global $bp;
-               return apply_filters( 'bp_get_messages_slug', $bp->messages->slug );
</del><ins>+                return apply_filters( 'bp_get_messages_slug', buddypress()->messages->slug );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1040,18 +1045,20 @@
</span><span class="cx"> function bp_message_get_notices() {
</span><span class="cx">  $notice = BP_Messages_Notice::get_active();
</span><span class="cx"> 
</span><del>-       if ( empty( $notice ) )
</del><ins>+        if ( empty( $notice ) ) {
</ins><span class="cx">           return false;
</span><ins>+       }
</ins><span class="cx"> 
</span><span class="cx">  $closed_notices = bp_get_user_meta( bp_loggedin_user_id(), 'closed_notices', true );
</span><span class="cx"> 
</span><del>-       if ( !$closed_notices )
</del><ins>+        if ( empty( $closed_notices ) ) {
</ins><span class="cx">           $closed_notices = array();
</span><ins>+       }
</ins><span class="cx"> 
</span><del>-       if ( is_array($closed_notices) ) {
</del><ins>+        if ( is_array( $closed_notices ) ) {
</ins><span class="cx">           if ( !in_array( $notice->id, $closed_notices ) && $notice->id ) {
</span><span class="cx">                  ?>
</span><del>-                       <div id="message" class="info notice" rel="n-<?php echo $notice->id ?>">
</del><ins>+                        <div id="message" class="info notice" rel="n-<?php echo esc_attr( $notice->id ); ?>">
</ins><span class="cx">                           <p>
</span><span class="cx">                                  <strong><?php echo stripslashes( wp_filter_kses( $notice->subject ) ) ?></strong><br />
</span><span class="cx">                                  <?php echo stripslashes( wp_filter_kses( $notice->message) ) ?>
</span><span class="lines">@@ -1076,8 +1083,9 @@
</span><span class="cx">   */
</span><span class="cx">  function bp_get_send_private_message_link() {
</span><span class="cx"> 
</span><del>-               if ( bp_is_my_profile() || !is_user_logged_in() )
</del><ins>+                if ( bp_is_my_profile() || ! is_user_logged_in() ) {
</ins><span class="cx">                   return false;
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( bp_displayed_user_id() ) ) );
</span><span class="cx">  }
</span><span class="lines">@@ -1136,8 +1144,7 @@
</span><span class="cx">   * @return string
</span><span class="cx">   */
</span><span class="cx">  function bp_get_message_loading_image_src() {
</span><del>-               global $bp;
-               return apply_filters( 'bp_get_message_loading_image_src', $bp->messages->image_base . '/ajax-loader.gif' );
</del><ins>+                return apply_filters( 'bp_get_message_loading_image_src', buddypress()->messages->image_base . '/ajax-loader.gif' );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1147,10 +1154,13 @@
</span><span class="cx">  $recipients = explode( ' ', bp_get_message_get_recipient_usernames() );
</span><span class="cx"> 
</span><span class="cx">  foreach ( $recipients as $recipient ) {
</span><del>-               $user_id = bp_is_username_compatibility_mode() ? bp_core_get_userid( $recipient ) : bp_core_get_userid_from_nicename( $recipient );
</del><span class="cx"> 
</span><del>-               if ( $user_id ) : ?>
</del><ins>+                $user_id = bp_is_username_compatibility_mode()
+                       ? bp_core_get_userid( $recipient )
+                       : bp_core_get_userid_from_nicename( $recipient );
</ins><span class="cx"> 
</span><ins>+               if ( ! empty( $user_id ) ) : ?>
+
</ins><span class="cx">                   <li id="un-<?php echo esc_attr( $recipient ); ?>" class="friend-tab">
</span><span class="cx">                          <span><?php
</span><span class="cx">                                  echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) );
</span><span class="lines">@@ -1282,8 +1292,9 @@
</span><span class="cx">   * @return bool True if there are items in the loop, otherwise false.
</span><span class="cx">   */
</span><span class="cx">  function has_messages() {
</span><del>-               if ( $this->message_count )
</del><ins>+                if ( $this->message_count ) {
</ins><span class="cx">                   return true;
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return false;
</span><span class="cx">  }
</span><span class="lines">@@ -1348,8 +1359,9 @@
</span><span class="cx">          $this->message     = $this->next_message();
</span><span class="cx"> 
</span><span class="cx">          // loop has just started
</span><del>-               if ( 0 == $this->current_message )
-                       do_action('thread_loop_start');
</del><ins>+                if ( 0 == $this->current_message ) {
+                       do_action( 'thread_loop_start' );
+               }
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1368,18 +1380,17 @@
</span><span class="cx"> function bp_thread_has_messages( $args = '' ) {
</span><span class="cx">  global $thread_template;
</span><span class="cx"> 
</span><del>-       $defaults = array(
</del><ins>+        $r = bp_parse_args( $args, array(
</ins><span class="cx">           'thread_id' => false,
</span><span class="cx">          'order'     => 'ASC'
</span><del>-       );
</del><ins>+        ), 'thread_has_messages' );
</ins><span class="cx"> 
</span><del>-       $r = wp_parse_args( $args, $defaults );
-       extract( $r, EXTR_SKIP );
</del><ins>+        if ( empty( $r['thread_id'] ) && bp_is_messages_component() && bp_is_current_action( 'view' ) ) {
+               $r['thread_id'] = (int) bp_action_variable( 0 );
+       }
</ins><span class="cx"> 
</span><del>-       if ( empty( $thread_id ) && bp_is_messages_component() && bp_is_current_action( 'view' ) )
-               $thread_id = (int) bp_action_variable( 0 );
</del><ins>+        $thread_template = new BP_Messages_Thread_Template( $r['thread_id'], $r['order'] );
</ins><span class="cx"> 
</span><del>-       $thread_template = new BP_Messages_Thread_Template( $thread_id, $order );
</del><span class="cx">   return $thread_template->has_messages();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1471,8 +1482,9 @@
</span><span class="cx"> 
</span><span class="cx">          $recipient_links = array();
</span><span class="cx"> 
</span><del>-               if ( count( $thread_template->thread->recipients ) >= 5 )
-                       return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count($thread_template->thread->recipients) ) );
</del><ins>+                if ( count( $thread_template->thread->recipients ) >= 5 ) {
+                       return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count( $thread_template->thread->recipients ) ) );
+               }
</ins><span class="cx"> 
</span><span class="cx">          foreach( (array) $thread_template->thread->recipients as $recipient ) {
</span><span class="cx">                  if ( (int) $recipient->user_id !== bp_loggedin_user_id() ) {
</span><span class="lines">@@ -1507,7 +1519,10 @@
</span><span class="cx">  function bp_get_the_thread_message_id() {
</span><span class="cx">          global $thread_template;
</span><span class="cx"> 
</span><del>-               $thread_message_id = isset( $thread_template->message->id ) ? (int) $thread_template->message->id : null;
</del><ins>+                $thread_message_id = isset( $thread_template->message->id )
+                       ? (int) $thread_template->message->id
+                       : null;
+
</ins><span class="cx">           return apply_filters( 'bp_get_the_thread_message_id', $thread_message_id );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -1619,16 +1634,19 @@
</span><span class="cx">  function bp_get_the_thread_message_sender_avatar_thumb( $args = '' ) {
</span><span class="cx">          global $thread_template;
</span><span class="cx"> 
</span><del>-               $defaults = array(
</del><ins>+                $r = bp_parse_args( $args, array(
</ins><span class="cx">                   'type'   => 'thumb',
</span><span class="cx">                  'width'  => false,
</span><span class="cx">                  'height' => false,
</span><del>-               );
</del><ins>+                ) );
</ins><span class="cx"> 
</span><del>-               $r = wp_parse_args( $args, $defaults );
-               extract( $r, EXTR_SKIP );
-
-               return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $thread_template->message->sender_id, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => bp_core_get_user_displayname( $thread_template->message->sender_id ) ) ) );
</del><ins>+                return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array(
+                       'item_id' => $thread_template->message->sender_id,
+                       'type'    => $r['type'],
+                       'width'   => $r['width'],
+                       'height'  => $r['height'],
+                       'alt'     => bp_core_get_user_displayname( $thread_template->message->sender_id )
+               ) ) );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1664,8 +1682,9 @@
</span><span class="cx"> 
</span><span class="cx">          $display_name = bp_core_get_user_displayname( $thread_template->message->sender_id );
</span><span class="cx"> 
</span><del>-               if ( empty( $display_name ) )
</del><ins>+                if ( empty( $display_name ) ) {
</ins><span class="cx">                   $display_name = __( 'Deleted User', 'buddypress' );
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return apply_filters( 'bp_get_the_thread_message_sender_name', $display_name );
</span><span class="cx">  }
</span><span class="lines">@@ -1682,9 +1701,7 @@
</span><span class="cx">   * @return string URL
</span><span class="cx">   */
</span><span class="cx">  function bp_get_the_thread_delete_link() {
</span><del>-               global $bp;
-
-               return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( bp_loggedin_user_domain() . $bp->messages->slug . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread' ) );
</del><ins>+                return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread' ) );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>

</body>
</html>