From: friendica Date: Sat, 24 Dec 2011 08:43:37 +0000 (-0800) Subject: Filter FB comments from people unknown to FB. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7d96fe70f6fd51bd8b19d2633c62d737bbb9dd69;p=friendica-addons.git Filter FB comments from people unknown to FB. --- diff --git a/facebook/facebook.php b/facebook/facebook.php index 845ddd9e..bb0b45ac 100644 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -525,6 +525,19 @@ function facebook_post_hook(&$a,&$b) { $reply = substr($r[0]['extid'],4); else return; + + $u = q("SELECT * FROM user where uid = %d limit 1", + intval($b['uid']) + ); + if(! count($u)) + return; + + // only accept comments from the item owner. Other contacts are unknown to FB. + + if(! link_compare($item['author-link'], $a->get_baseurl() . '/profile/' . $u[0]['nickname'])) + return; + + logger('facebook reply id=' . $reply); }