]> git.mxchange.org Git - friendica-addons.git/commitdiff
fbsync: Importing posts only from contacts you have in your contact list should work now
authorMichael Vogel <icarus@dabo.de>
Fri, 8 Nov 2013 07:23:00 +0000 (08:23 +0100)
committerMichael Vogel <icarus@dabo.de>
Fri, 8 Nov 2013 07:23:00 +0000 (08:23 +0100)
fbsync/fbsync.php

index 000aeaa1b04d4e308f0ae0e60ceea8d402c1b4af..13a504dcf3e5162861ef8246df1d423edf2e8625 100644 (file)
@@ -243,10 +243,14 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
        if ($contact_id == 0) {
                $contact_id = fbsync_fetch_contact($uid, $contacts[$post->source_id], $create_user);
 
-               if (($contact_id <= 0) AND !$create_user)
+               if (($contact_id <= 0) AND !$create_user) {
+                       logger('fbsync_createpost: No matching contact found. Post not imported '.print_r($post, true), LOGGER_DEBUG);
                        return;
-               elseif ($contact_id == 0)
+               } elseif ($contact_id == 0) {
+                       // This case should never happen
+                       logger('fbsync_createpost: No matching contact found. Using own id. (Should never happen) '.print_r($post, true), LOGGER_DEBUG);
                        $contact_id = $self[0]["id"];
+               }
 
                $postarray['contact-id'] = $contact_id;
        }