[buddypress-trac] [BuddyPress] #3980: bp_activity_at_name_filter_updates() causes activity to be saved twice
buddypress-trac
noreply at wordpress.org
Sat Nov 24 01:11:17 UTC 2012
#3980: bp_activity_at_name_filter_updates() causes activity to be saved twice
------------------------------------+-----------------------------
Reporter: r-a-y | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Activity | Version: 1.5
Severity: normal | Resolution:
Keywords: dev-feedback has-patch |
------------------------------------+-----------------------------
Changes (by r-a-y):
* keywords: dev-feedback => dev-feedback has-patch
Comment:
Boone, your idea was basically the same as mine!
Here's a rundown of the changes in the patches:
* New: `bp_activity_at_name_send_emails()` - This is fired if @mentions
are detected in `bp_activity_at_name_filter_updates()`.
* Altered: `bp_activity_at_name_filter_updates()` - Removes the email
firing logic into `bp_activity_at_name_send_emails()`. Linkifies
@mentions before saving the activity item.
* Altered: `bp_activity_at_name_filter()` - Changed so the function only
linkifies @mentions in content that is not an activity item.
* Altered: `bp_activity_find_mentions()` - Changed so it returns an
associative array with the user ID as key and username as value. This
logic was being duplicated a few times in other functions, so I moved it
here.
* Altered: `bp_activity_adjust_mention_count()` - Removed unnecessary
`BP_Activity_Activity` query. Moved mention updating into
`bp_activity_update_mention_count_for_user()`.
* New: `bp_activity_update_mention_count_for_user()` - Extrapolated from
`bp_activity_adjust_mention_count()`.
I've done two patches - one without global stuffing and one with. I
personally don't mind saving the temporary variable, but others might not
like it, which is why there are two patches!
Feedback welcome.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3980#comment:11>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list