Some probably simple PHP issues.

I'll try to be as concise as possible here:

I'm using HypeAlive 1.9.0.2 with the adequate HypeFramework installed.  Now, comments were working by default on messageboard posts, but not on thewire posts.

 

In mod/hypeAlive/views/default/framework/comments/forms.php the variables depicted at the top are:

$class = elgg_extract('class', $vars);

$comment_guid = elgg_extract('comment_guid', $vars, false);
$comment = get_entity($comment_guid);

$container = elgg_extract('entity', $vars, false);

on line 14 there is this:

if (!elgg_is_logged_in() || !$container || !$container->canComment()) {
return true;
}

I've played around a bit with it, and actually got it working to this point: If a user is logged in and is friends with the owner of the content, they are allowed to comment on it (including wire posts)  I've changed the variables to:

$class = elgg_extract('class', $vars);
$owner = get_entity($comment->owner_guid);
$comment_guid = elgg_extract('comment_guid', $vars, false);
$comment = get_entity($comment_guid);
$user = elgg_get_logged_in_user_entity();
$container = elgg_extract('entity', $vars, false);

And I've changed line 14 to:

if (!elgg_is_logged_in() || !check_entity_relationship($user->guid, 'friend', $container->owner_guid)) {
return true;
}

This allows all logged in users who are friends with the owner of the content to comment on it, however I'd also like to pass a condition that if the logged in user is the owner of the content, they can comment on their own stuff.  Any ideas?  It's probably a pretty simple thing that I'm missing.