fbsync: Setup for creating users is ready

This commit is contained in:
Michael Vogel 2013-10-27 22:47:58 +01:00
parent 85e3edcb4f
commit 6461c0a50d

View file

@ -8,15 +8,14 @@
/* To-Do /* To-Do
FBSync: FBSync:
- A: "Nicht automatisch anlegen" einbauen - A: Make shared posts look like shared posts
- B: Threading für empfangene Kommentare - B: Threading for incoming comments
- B: Posts von Seiten, die man nicht selber abonniert hat - C: Receiving likes for comments
- C: Like für Kommentare empfangen?
FBPost: FBPost:
- B: Post auf Seite nicht als Seite - A: Posts to pages currently have the page as sender - not the user
- B: Like für Kommentare senden - B: Sending likes for comments
- C: Threading für gesendete Kommentare - C: Threading for sent comments
*/ */
require_once("addon/fbpost/fbpost.php"); require_once("addon/fbpost/fbpost.php");
@ -114,7 +113,7 @@ function fbsync_cron($a,$b) {
set_config('fbsync','last_poll', time()); set_config('fbsync','last_poll', time());
} }
function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post) { function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $create_user) {
// check if it was already imported // check if it was already imported
$r = q("SELECT * FROM `item` WHERE `uid` = %d AND `uri` = '%s' LIMIT 1", $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `uri` = '%s' LIMIT 1",
@ -136,7 +135,7 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post) {
$postarray['parent-uri'] = $postarray['uri']; $postarray['parent-uri'] = $postarray['uri'];
$postarray['plink'] = $post->permalink; $postarray['plink'] = $post->permalink;
$contact_id = fbsync_fetch_contact($uid, $contacts[$post->source_id], true); $contact_id = fbsync_fetch_contact($uid, $contacts[$post->source_id], $create_user);
if ($contact_id < 0) if ($contact_id < 0)
return; return;
@ -659,7 +658,7 @@ function fbsync_fetchfeed($a, $uid) {
require_once('include/items.php'); require_once('include/items.php');
//if ($last_updated == "") if ($last_updated == "")
$last_updated = 0; $last_updated = 0;
logger("fbsync_fetchfeed: fetching content for user ".$self_id); logger("fbsync_fetchfeed: fetching content for user ".$self_id);
@ -763,7 +762,7 @@ function fbsync_fetchfeed($a, $uid) {
// parent_post_id - Erkennen von geteilten Posts? // parent_post_id - Erkennen von geteilten Posts?
fbsync_createpost($a, $uid, $self, $contacts, $application_data, $post); fbsync_createpost($a, $uid, $self, $contacts, $application_data, $post, $create_user);
} }
foreach ($comment_data AS $comment) { foreach ($comment_data AS $comment) {