Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All the activities in the stream of the user profil get shown as reshared #26

Open
TheVrai opened this issue May 16, 2018 · 7 comments
Open
Labels

Comments

@TheVrai
Copy link

TheVrai commented May 16, 2018

In v.2.1, for WP 4.9.4, BP 2.9.4 :
all the activities in the stream of the user profil get shown as reshared, if you choose to modify the activity avatar to be full and not thumb.
It is due to the line #390 of the script.js which look whether the src of the activity avatar is different to mark it as reshared.
I'm trying to patch it, probably by parsing the classes of the avatars (which the id number in it) and then will do a pull request.
Thx for all the great job !

@ShastinaSandman
Copy link

Wondering if there was an update on this... same thing happened to me as well. :-/

@TheVrai
Copy link
Author

TheVrai commented May 30, 2019

Hi,
I've done a patch of the script which is working till now.
It's from the line #391, to #401, replace it with :
` if ( bpReshare.displayedUser ) {
var activityAvatar = $( selector ).find( '.activity-avatar' ),
/*
**Change by TheVrai : avatar id parsed in the class instead of the img src
**
*/
displayedUserAvatarId = $( bpReshare.displayedUser.avatar ).prop( 'class' ).split( 'avatar' )[1];

			if ( displayedUserAvatarId !== activityAvatar.find( 'img' ).prop( 'class' ).split( 'avatar' )[1] && ! $( selector ).find( '.activity-reshared-by' ).length ) {
				/*
			    **Change by TheVrai : to avoid marking up friendship created activities
			    **
			    */
				if($( selector ).prop('class').indexOf('friendship_created')!==-1 ){
			    	var secondaryActityAvatarId = $( selector ).find('.activity-header img').prop('class').split('avatar')[1];
				    if(displayedUserAvatarId == secondaryActityAvatarId ){
				    	return;
				    }
			    }
				$( activityAvatar ).before(
				$( '<div></div>' ).addClass( 'activity-reshared-by' )
			                  .html( bpReshare.displayedUser.resharedText.replace( '%s', bpReshare.displayedUser.avatar ) )
				);						
			}
		}`

I'm doing a pull request soon.

@ShastinaSandman
Copy link

Sadly that did not work for me :( any other ideas?

@imath imath added the Needs PR label Jul 6, 2019
@imath
Copy link
Owner

imath commented Jul 6, 2019

I'm not sure to understand the issue. If I rephrase it like this:

All the activities posted by the user are shown into the Reshared Activities subnav of the user's profile activities

is it what's happening. Because I've just found a bug about it when the option to order the stream by number of reshares in on.

@ShastinaSandman
Copy link

Hello imath,

I will activate the plugin today on my staging site, update the code and see if the issue is still there and let you know. Thanks so much for all your continuous hard work. 🤗

@ShastinaSandman
Copy link

It works!! Thank you so much :) so thankful

@imath
Copy link
Owner

imath commented Jul 16, 2019

Thanks a lot for your feedback 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants