]> git.mxchange.org Git - friendica-addons.git/commitdiff
Filter FB comments from people unknown to FB.
authorfriendica <info@friendica.com>
Sat, 24 Dec 2011 08:43:37 +0000 (00:43 -0800)
committerfriendica <info@friendica.com>
Sat, 24 Dec 2011 08:43:37 +0000 (00:43 -0800)
facebook/facebook.php

index 845ddd9e816f4afde3a0bd4e75a685aca308d594..bb0b45ac71988e189c5531e3f310b6bcbad43d59 100644 (file)
@@ -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);
        }