<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[BuddyPress] [2666] trunk:
  Make sure activity comments are separating their action an content and also being hidden publicly if on a private activity
 .</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2666</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-02-11 12:50:00 +0000 (Thu, 11 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make sure activity comments are separating their action an content and also being hidden publicly if on a private activity.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2665 => 2666)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2010-02-11 11:54:44 UTC (rev 2665)
+++ trunk/bp-activity/bp-activity-templatetags.php        2010-02-11 12:50:00 UTC (rev 2666)
</span><span class="lines">@@ -190,6 +190,8 @@
</span><span class="cx">                 if ( 'just-me' == $scope )
</span><span class="cx">                         $display_comments = 'stream';
</span><span class="cx"> 
</span><ins>+                $show_hidden = ( $user_id == $bp-&gt;loggedin_user-&gt;id ) ? 1 : 0;
+
</ins><span class="cx">                 if ( $user_id = ( !empty( $bp-&gt;displayed_user-&gt;id ) ) ? $bp-&gt;displayed_user-&gt;id : $bp-&gt;loggedin_user-&gt;id ) {
</span><span class="cx">                         switch ( $scope ) {
</span><span class="cx">                                 case 'friends':
</span><span class="lines">@@ -208,7 +210,7 @@
</span><span class="cx"> 
</span><span class="cx">                                                 $object = $bp-&gt;groups-&gt;id;
</span><span class="cx">                                                 $primary_id = implode( ',', (array)$groups['groups'] );
</span><del>-                                                $show_hidden = ( $user_id == $bp-&gt;loggedin_user-&gt;id ) ? 1 : 0;
</del><ins>+
</ins><span class="cx">                                                 $user_id = false;
</span><span class="cx">                                         }
</span><span class="cx">                                         break;
</span><span class="lines">@@ -218,13 +220,11 @@
</span><span class="cx">                                                 return false;
</span><span class="cx"> 
</span><span class="cx">                                         $include = implode( ',', (array)$favs );
</span><del>-                                        $show_hidden = ( $user_id == $bp-&gt;loggedin_user-&gt;id ) ? 1 : 0;
</del><span class="cx">                                         break;
</span><span class="cx">                                 case 'mentions':
</span><span class="cx">                                         $user_nicename = ( !empty( $bp-&gt;displayed_user-&gt;id ) ) ? $bp-&gt;displayed_user-&gt;userdata-&gt;user_nicename : $bp-&gt;loggedin_user-&gt;userdata-&gt;user_nicename;
</span><span class="cx">                                         $user_login = ( !empty( $bp-&gt;displayed_user-&gt;id ) ) ? $bp-&gt;displayed_user-&gt;userdata-&gt;user_login : $bp-&gt;loggedin_user-&gt;userdata-&gt;user_login;
</span><span class="cx">                                         $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login );
</span><del>-                                        $show_hidden = ( $user_id == $bp-&gt;loggedin_user-&gt;id ) ? 1 : 0;
</del><span class="cx">                                         $display_comments = 'stream';
</span><span class="cx">                                         $user_id = false;
</span><span class="cx">                                         break;
</span><span class="lines">@@ -570,6 +570,8 @@
</span><span class="cx">                                 if ( !$comment-&gt;user_fullname )
</span><span class="cx">                                         $comment-&gt;user_fullname = $comment-&gt;display_name;
</span><span class="cx"> 
</span><ins>+                                var_dump($comment-&gt;content);
+
</ins><span class="cx">                                 $content .= '&lt;li id=&quot;acomment-' . $comment-&gt;id . '&quot;&gt;';
</span><span class="cx">                                 $content .= '&lt;div class=&quot;acomment-avatar&quot;&gt;&lt;a href=&quot;' . bp_core_get_user_domain( $comment-&gt;user_id, $comment-&gt;user_nicename, $comment-&gt;user_login ) . '&quot;&gt;' . bp_core_fetch_avatar( array( 'item_id' =&gt; $comment-&gt;user_id, 'width' =&gt; 25, 'height' =&gt; 25, 'email' =&gt; $comment-&gt;user_email ) ) . '&lt;/a&gt;&lt;/div&gt;';
</span><span class="cx">                                 $content .= '&lt;div class=&quot;acomment-meta&quot;&gt;&lt;a href=&quot;' . bp_core_get_user_domain( $comment-&gt;user_id, $comment-&gt;user_nicename, $comment-&gt;user_login ) . '&quot;&gt;' . apply_filters( 'bp_get_member_name', $comment-&gt;user_fullname ) . '&lt;/a&gt; &amp;middot; ' . sprintf( __( '%s ago', 'buddypress' ), bp_core_time_since( strtotime( $comment-&gt;date_recorded ) ) );
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2665 => 2666)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2010-02-11 11:54:44 UTC (rev 2665)
+++ trunk/bp-activity.php        2010-02-11 12:50:00 UTC (rev 2666)
</span><span class="lines">@@ -626,18 +626,20 @@
</span><span class="cx">         if ( empty($parent_id) )
</span><span class="cx">                 $parent_id = $activity_id;
</span><span class="cx"> 
</span><del>-        /* Insert the &quot;user posted a new activity comment header text&quot; */
-        $comment_header = '&lt;div class=&quot;comment-header&quot;&gt;' . sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) . ' &lt;span class=&quot;time-since&quot;&gt;%s&lt;/span&gt;&lt;/div&gt; ';
</del><ins>+        /* Check to see if the parent activity is hidden, and if so, hide this comment publically. */
+        $activity = new BP_Activity_Activity( $activity_id );
+        $is_hidden = ( (int)$activity-&gt;hide_sitewide ) ? 1 : 0;
</ins><span class="cx"> 
</span><span class="cx">         /* Insert the activity comment */
</span><span class="cx">         $comment_id = bp_activity_add( array(
</span><del>-                'content' =&gt; apply_filters( 'bp_activity_comment_content', $comment_header . '&lt;div class=&quot;activity-inner&quot;&gt;' . $content . '&lt;/div&gt;' ),
-                'primary_link' =&gt; '',
</del><ins>+                'action' =&gt; apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ),
+                'content' =&gt; apply_filters( 'bp_activity_comment_content', '&lt;div class=&quot;activity-inner&quot;&gt;' . $content . '&lt;/div&gt;' ),
</ins><span class="cx">                 'component' =&gt; $bp-&gt;activity-&gt;id,
</span><span class="cx">                 'type' =&gt; 'activity_comment',
</span><span class="cx">                 'user_id' =&gt; $user_id,
</span><span class="cx">                 'item_id' =&gt; $activity_id,
</span><del>-                'secondary_item_id' =&gt; $parent_id
</del><ins>+                'secondary_item_id' =&gt; $parent_id,
+                'hide_sitewide' =&gt; $is_hidden
</ins><span class="cx">         ) );
</span><span class="cx"> 
</span><span class="cx">         /* Send an email notification if settings allow */
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2665 => 2666)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2010-02-11 11:54:44 UTC (rev 2665)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2010-02-11 12:50:00 UTC (rev 2666)
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx">                                 &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;div class=&quot;acomment-content&quot;&gt;
</span><del>-                                        &lt;?php bp_activity_content() ?&gt;
</del><ins>+                                        &lt;?php bp_activity_content_body() ?&gt;
</ins><span class="cx">                                 &lt;/div&gt;
</span><span class="cx">                         &lt;/li&gt;
</span><span class="cx">                 &lt;?php endwhile; ?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>