]> git.mxchange.org Git - friendica.git/commitdiff
ensure contact exists for toplevel post
authorFriendika <info@friendika.com>
Thu, 28 Apr 2011 00:06:42 +0000 (17:06 -0700)
committerFriendika <info@friendika.com>
Thu, 28 Apr 2011 00:06:42 +0000 (17:06 -0700)
addon/facebook/facebook.php

index c2ccfa1316009808fd60d4463022b40e74f0659c..76bf878b52ba1726f9e7edb0ec0e62e5419c1437 100644 (file)
@@ -227,6 +227,12 @@ function facebook_content(&$a) {
                notice( t('Facebook disabled') . EOL);
        }
 
+       if($a->argc > 1 && $a->argv[1] === 'friends') {
+               fb_get_friends(local_user());
+               notice( t('Updating contacts') . EOL);
+       }
+
+
        $fb_installed = get_pconfig(local_user(),'facebook','post');
 
        $appid = get_config('facebook','appid');
@@ -595,6 +601,12 @@ function fb_consume_stream($uid,$j,$wall = false) {
                                if(count($r))
                                        $datarray['contact-id'] = $r[0]['id'];
                        }
+
+                       // don't store post if we don't have a contact
+
+                       if(! x($datarray,'contact-id'))
+                               continue; 
+
                        $datarray['verb'] = ACTIVITY_POST;                                              
                        if($wall) {
                                $datarray['owner-name'] = $self[0]['name'];