mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 22:13:16 +00:00
Synchronize all Likes
This commit is contained in:
parent
4018885640
commit
ec78e5eb8d
1 changed files with 13 additions and 3 deletions
|
@ -1561,11 +1561,21 @@ function fb_consume_status(&$a, &$user, &$entry, &$self, $fb_id, $wall, &$orig_p
|
||||||
foreach ($j->comments->data as $cmnt)
|
foreach ($j->comments->data as $cmnt)
|
||||||
fb_consume_comment($a, $user, $self, $fb_id, $wall, $orig_post, $cmnt);
|
fb_consume_comment($a, $user, $self, $fb_id, $wall, $orig_post, $cmnt);
|
||||||
|
|
||||||
if (isset($j->likes) && isset($j->likes->data))
|
if (isset($j->likes) && isset($j->likes->data) && isset($j->likes->count)) {
|
||||||
foreach ($j->likes->data as $likers)
|
if (count($j->likes->data) == $j->likes->count) {
|
||||||
|
foreach ($j->likes->data as $likers) fb_consume_like($a, $user, $self, $fb_id, $wall, $orig_post, $likers);
|
||||||
|
} else {
|
||||||
|
$t = fetch_url('https://graph.facebook.com/' . $entry->id . '/likes?access_token=' . $access_token);
|
||||||
|
if ($t) {
|
||||||
|
$k = json_decode($t);
|
||||||
|
if (isset($k->data))
|
||||||
|
foreach ($k->data as $likers)
|
||||||
fb_consume_like($a, $user, $self, $fb_id, $wall, $orig_post, $likers);
|
fb_consume_like($a, $user, $self, $fb_id, $wall, $orig_post, $likers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
|
|
Loading…
Reference in a new issue