Skip to:
Content

BuddyPress.org

Opened 16 years ago

Closed 16 years ago

#2397 closed enhancement (fixed)

Add a do_action in bp_activity_at_message_notification()

Reported by: r-a-y Owned by:
Priority: normal Milestone: 1.5
Component: Activity Version:
Severity: Keywords:
Cc:

Description

I would like to propose the following do_action after line 8 in bp-activity-notifications.php:

do_action( 'activity_before_notify', $content, $poster_user_id, $usernames );

This will help plugin writers to manipulate what happens when someone attempts to send an @mention.

Possible use cases include checking friendship status, blocking @mention emails, limiting @mentions per activity update, creating an ignore @mentions list, etc.

Thanks to jessica120 for spamming and inspiring this ticket! ;)
http://buddypress.org/community/members/jessica120/

Listing as a defect so it'll be seen, but feel free to drop it down to an enhancement.

Change History (4)

#1 @johnjamesjacoby
16 years ago

  • Milestone 1.31.2.5

#2 @johnjamesjacoby
16 years ago

  • Milestone 1.2.51.3
  • Type defectenhancement

Sorry r-a-y, pushing to 1.3 as an enhancement. A do_action there doesn't directly manipulate any of that data, and I'm not sure that filtering all of those values before hand makes sense either.

This probably needs further review along with the rest of the notifications, since it would make sense to try and make some global changes where possible.

#3 @r-a-y
16 years ago

Hey JJJ, you're right. I meant to write apply_filters, instead of do_action.

$usernames = apply_filters( 'activity_username_notification', $usernames, $poster_user_id );

Gotcha about filtering though.

#4 @boonebgorges
16 years ago

  • Resolutionfixed
  • Status newclosed

(In [3362]) Adds do_action hooks after notification emails are sent throughout BuddyPress. Fixes #2397. Props r-a-y and jessica120 for prodding

Note: See TracTickets for help on using tickets.