Skip to:

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2568 closed defect (bug) (fixed)

[patch] Compose Private Message Filtering

Reported by: jeffsayre's profile jeffsayre Owned by: jeffsayre's profile jeffsayre
Milestone: 1.2.6 Priority: major
Severity: Version:
Component: Core Keywords: has-patch, privacy, filters, messaging


To allow for the filtering of message recipients in the compose private message screen, there needs to be a filter added to the concatenated recipient array. This will allow developers to gain access to the message recipient list before the message is sent. This is necessary for the Privacy Component.

With this filter, the Privacy Component will be able to offer complete privacy filtering for private messages. Before, the only option was to hide the "Send Private Message" button (see Trac ticket But, members could still send a user a PM via the Compose Message screen.

With this filter, the Privacy Component will be able to remove a user's name from the recipient list in all composed messages, thereby removing the ability of unwanted users from sending PMs. A user can still include a given user’s name in the recipients’ list, but it will be filtered out before the message is actually sent.

Attachments (1)

jeffsayre_2568_button.patch (797 bytes) - added by jeffsayre 14 years ago.
In bp-messages.php, add a filter to function messages_screen_compose()

Download all attachments as: .zip

Change History (6)

14 years ago

In bp-messages.php, add a filter to function messages_screen_compose()

#1 @r-a-y
14 years ago

Hi Jeff,

You can do this without the proposed patch (although it would be nice to have this filter!).

Check out how I do it in my PMs for Friends plugin. I do the recipient check before the message is saved and sent.

#2 @jeffsayre
14 years ago


Yes, I am aware of the action hook within bp-messages-classes.php. My patch allows for filtering before the message is sent as well. Except it does so with a new filter hook added to bp-messages.php. It uses the recipient list after the two recipient arrays are merged (the autocomplete recipient array and the manually entered recipient array).

I think a filter added to bp-messages.php is easier for most theme designers to use as some feel confused by action and filter hooks in class files--the code in a class file can scare people. This extends BuddyPress, making it more template-designer friendly.

#3 @johnjamesjacoby
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3166]) Fixes #2568 props jeffsayre

#4 @johnjamesjacoby
14 years ago

I put this one through, but I think if we're going to start messing with removing recipients from PM's, we're going to want a notification of some kind to let the user know their request was altered.

#5 @jeffsayre
14 years ago

The Privacy Component will indeed provide a message listing the recipient(s) that did not / could not receive the message.

Note: See TracTickets for help on using tickets.