[buddypress-trac] [BuddyPress] #4429: User banned from public group can still reply to group activity items
buddypress-trac
noreply at wordpress.org
Mon Dec 17 17:02:33 UTC 2012
#4429: User banned from public group can still reply to group activity items
-----------------------------------------+--------------------------
Reporter: DJPaul | Owner: rachelbaker
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 1.7
Component: Activity | Version:
Severity: normal | Resolution:
Keywords: reporter-feedback 1.8-early |
-----------------------------------------+--------------------------
Changes (by boonebgorges):
* keywords: needs-refresh reporter-feedback => reporter-feedback 1.8-early
Comment:
I just whipped up a patch along the lines of what rachelbaker and DJPaul
have been suggesting here. See 4229.01.patch.
It works, but is not ready for primetime. In order to make it a truly
general solution (one that works in the sitewide activity stream etc, as
well as on a single group activity stream), you have to do this for each
activity item:
`groups_is_user_banned( bp_loggedin_user_id(),
bp_get_activity_item_id() )`
This results in an additional database hit for every single group-related
activity item. The is_banned data is not cached at all. On activity pages,
this could result in 20 extra queries per page, which is unacceptable.
We should be doing one or both of the following:
- Functions like `groups_is_user_banned()` should cache their results
somehow
- When fetching the activity stream and building the
`$activities_template` global, also slurp up whether the logged-in user is
a member of each returned activity item.
There's no time for either in this cycle. Let's take a swing for the next
cycle.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4429#comment:7>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list