#2568 closed defect (bug) (fixed)
[patch] Compose Private Message Filtering
Reported by: | jeffsayre | Owned by: | jeffsayre |
---|---|---|---|
Milestone: | 1.2.6 | Priority: | major |
Severity: | Version: | ||
Component: | Core | Keywords: | has-patch, privacy, filters, messaging |
Cc: |
Description
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 http://trac.buddypress.org/ticket/2566). 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)
Change History (6)
#1
@
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
@
14 years ago
r-a-y
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.
In bp-messages.php, add a filter to function messages_screen_compose()