Opened 10 years ago
Closed 10 years ago
#6055 closed defect (bug) (fixed)
Cancelling a friendship never deletes the corresponding activities
Reported by: | imath | Owned by: | imath |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | 1.1 |
Component: | Friends | Keywords: | has-patch commit |
Cc: |
Description (last modified by )
Relative to #6040
Since version 1.1, the action 'friendship_accepted' is not used anymore. Each time a friendship is confirmed 2 activities are created for each user of the relationship (1 of the activity is hide_sitewide) and the action is 'friendship_created' for both activities.
The problem is in friends_remove_friend()
when this function is using friends_delete_activity()
, the action argument is using the action that has disappeared since 1.1. As a result, activities about the friendship are never deleted.
I suggest the attached patch to make sure friends_remove_friend() will actually remove the activities.
Attachments (2)
Change History (12)
#3
in reply to:
↑ 2
@
10 years ago
Replying to r-a-y:
Looks good, imath!
Thanks for your feedback r-a-y :)
If no objections, i'll commit it before the end of the week.
#5
in reply to:
↑ 4
@
10 years ago
Replying to DJPaul:
Did you mean to include
'type' => ''
?
Yes, as the item_id (friendship id) is unique for the friendship component, it's a way to be sure any activities related to the friendship are deleted (eg: old 'friendship_accepted' one).
But if you think, we should provide a type, there's no problem, i'll update the patch with 'type' => 'friendship_created'
#6
@
10 years ago
I agree with imath. I think you can leave 'type'
blank.
The only thing I can see as a problem is if a plugin is adding its own custom friend activity items. But, even if that is the case, those items should probably be removed if a friendship is deleted.
Looks good, imath!