Some relationships have to be approved, we need to pass it as param to load function. Also some relationships are one way and some are not. So it can happen that current user activity is included to friend activity block.
$type = user_relationships_type_load($delta);
// we need to check the relationship type
$params = array('user' => $user->uid, 'rtid' => $delta);
if ($type->requires_approval) {
$params['approved'] = 1;
}
$relationships = user_relationships_load($params);
$uids = array();
foreach ($relationships as $relationship) {
if ($type->is_oneway) {
$uids[] = $relationship->requestee_id;
}
else {
// user can be requester or requestee if it isn't oneway relationship
$uids[] = $relationship->requestee_id != $user->uid ? $relationship->requestee_id : $relationship->requester_id;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | user_replationships_approval_oneway.patch | 1.69 KB | sirkitree |
Comments
Comment #1
sirkitree commentedComment #2
sirkitree commentedComment #3
sirkitree commentedComment #4
sirkitree commentedComment #5
sirkitree commentedcommitted to dev.