Skip to content

Commit

Permalink
mimic logic used in twitter service for auto approval of likes
Browse files Browse the repository at this point in the history
  • Loading branch information
jondavidjohn committed Sep 12, 2012
1 parent 6d72c2f commit d046de0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/social/service/facebook.php
Expand Up @@ -348,10 +348,6 @@ public function save_aggregated_comments(&$post) {
'comment_date' => current_time('mysql'),
'comment_date_gmt' => current_time('mysql', 1),
));

if (apply_filters('social_approve_likes_and_retweets', true)) {
$commentdata['comment_approved'] = 1;
}
}

$user_id = (isset($result->like) ? $result->id : $result->from->id);
Expand All @@ -361,7 +357,10 @@ public function save_aggregated_comments(&$post) {
));

$result_id = (isset($result->status_id) ? $result->status_id : $result->id);
if (($commentdata = $this->allow_comment($commentdata, $result_id, $post)) === false) {
if (apply_filters('social_approve_likes_and_retweets', true) && isset($result->like)) {
$commentdata['comment_approved'] = 1;
}
else if (($commentdata = $this->allow_comment($commentdata, $result_id, $post)) === false) {
continue;
}

Expand All @@ -380,7 +379,7 @@ public function save_aggregated_comments(&$post) {
$comment_id = 0;
try
{
Social::Log('[facebook] Attempting to save commentdata: :commentdata', array(
Social::Log('Attempting to save commentdata: :commentdata', array(
'commentdata' => print_r($commentdata, true)
));
$comment_id = wp_insert_comment($commentdata);
Expand Down

0 comments on commit d046de0

Please sign in to comment.