[buddypress-trac] [BuddyPress Trac] #6597: Targeting the 'groups_leave_group' action can be difficult

buddypress-trac noreply at wordpress.org
Mon Aug 24 20:26:11 UTC 2015


#6597: Targeting the 'groups_leave_group' action can be difficult
------------------------------------+------------------------------
 Reporter:  thebrandonallen         |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Component - Groups      |     Version:  2.3.0
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+------------------------------
Changes (by dcavins):

 * cc: dcavins (added)


Comment:

 Replying to [comment:4 r-a-y]:

 > The more I'm thinking about it, the more I like your initial solution,
 thebrandonallen:
 >
 > > The easiest solution would be to replace the `groups_remove_member()`
 call with a call to `BP_Groups_Member::remove()`. The problem with that is
 that we then have two nearly identical functions.

 I'm working to extricate invitations and membership requests from the
 group membership table, so using `uninvite_user` to remove a member from a
 group doesn't look good to me.

 Could we determine if the user was being removed or leaving a group by
 comparing the passed `$user_id` to the current user id? If they're the
 same, it was self-initiated; if they're different, we know that someone
 else initiated the action.

 I think being able to target those two actions separately is useful. The
 question to me is whether it makes sense to continue having both functions
 or to roll them into one that's a bit more context aware.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6597#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list