Index: bp-themes/bp-default/_inc/ajax.php
===================================================================
--- bp-themes/bp-default/_inc/ajax.php	(révision 6970)
+++ bp-themes/bp-default/_inc/ajax.php	(copie de travail)
@@ -126,6 +126,12 @@
 	if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
 		$qs[] = 'page=' . $_POST['page'];
 
+	// exludes activity just posted and avoids duplicate ids
+	if ( ! empty( $_POST['exclude_just_posted'] ) ) {
+		$just_posted = wp_parse_id_list( $_POST['exclude_just_posted'] );
+		$qs[] = 'exclude=' . implode( ',', $just_posted );
+	}
+
 	$object_search_text = bp_get_search_default_text( $object );
  	if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
 		$qs[] = 'search_terms=' . $_POST['search_terms'];
Index: bp-themes/bp-default/_inc/global.js
===================================================================
--- bp-themes/bp-default/_inc/global.js	(révision 6970)
+++ bp-themes/bp-default/_inc/global.js	(copie de travail)
@@ -102,7 +102,7 @@
 				}
 
 				jq("ul#activity-stream").prepend(response);
-				jq("ul#activity-stream li:first").addClass('new-update');
+				jq("ul#activity-stream li:first").addClass('new-update just-posted');
 
 				if ( 0 != jq("#latest-update").length ) {
 					var l = jq("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
@@ -301,10 +301,20 @@
 
 			var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
 
+			var just_posted = '';
+			
+			jq('#buddypress li.just-posted').each( function(){
+				just_posted += jq(this).attr('id').replace( 'activity-','' ) + ',';
+			});
+			
+			if( just_posted.length )
+				just_posted = just_posted.substr( 0, just_posted.length - 1 );
+
 			jq.post( ajaxurl, {
 				action: 'activity_get_older_updates',
 				'cookie': bp_get_cookies(),
-				'page': oldest_page
+				'page': oldest_page,
+				'exclude_just_posted':just_posted
 			},
 			function(response)
 			{
Index: bp-templates/bp-legacy/buddypress-functions.php
===================================================================
--- bp-templates/bp-legacy/buddypress-functions.php	(révision 6970)
+++ bp-templates/bp-legacy/buddypress-functions.php	(copie de travail)
@@ -416,6 +416,12 @@
 	if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
 		$qs[] = 'page=' . $_POST['page'];
 
+	// exludes activity just posted and avoids duplicate ids
+	if ( ! empty( $_POST['exclude_just_posted'] ) ) {
+		$just_posted = wp_parse_id_list( $_POST['exclude_just_posted'] );
+		$qs[] = 'exclude=' . implode( ',', $just_posted );
+	}
+
 	$object_search_text = bp_get_search_default_text( $object );
  	if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
 		$qs[] = 'search_terms=' . $_POST['search_terms'];
Index: bp-templates/bp-legacy/js/buddypress.js
===================================================================
--- bp-templates/bp-legacy/js/buddypress.js	(révision 6970)
+++ bp-templates/bp-legacy/js/buddypress.js	(copie de travail)
@@ -102,7 +102,7 @@
 				}
 
 				jq("#activity-stream").prepend(response);
-				jq("#activity-stream li:first").addClass('new-update');
+				jq("#activity-stream li:first").addClass('new-update just-posted');
 
 				if ( 0 != jq("#latest-update").length ) {
 					var l = jq("#activity-stream li.new-update .activity-content .activity-inner p").html();
@@ -304,10 +304,20 @@
 
 			var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
 
+			var just_posted = '';
+			
+			jq('#buddypress li.just-posted').each( function(){
+				just_posted += jq(this).attr('id').replace( 'activity-','' ) + ',';
+			});
+			
+			if( just_posted.length )
+				just_posted = just_posted.substr( 0, just_posted.length - 1 );
+
 			jq.post( ajaxurl, {
 				action: 'activity_get_older_updates',
 				'cookie': bp_get_cookies(),
-				'page': oldest_page
+				'page': oldest_page,
+				'exclude_just_posted':just_posted
 			},
 			function(response)
 			{
