aboutsummaryrefslogtreecommitdiffstats
path: root/addon/facebook/facebook.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-27 15:33:01 -0700
committerFriendika <info@friendika.com>2011-05-27 15:33:01 -0700
commita2b26948d8e472cecd3be6be524b92d86e8f3c4f (patch)
tree329910a427706c56bdcbe7245a7e5741129098f2 /addon/facebook/facebook.php
parentb93f0df890825cca396c4d038aa52d0ac677e82a (diff)
downloadvolse-hubzilla-a2b26948d8e472cecd3be6be524b92d86e8f3c4f.tar.gz
volse-hubzilla-a2b26948d8e472cecd3be6be524b92d86e8f3c4f.tar.bz2
volse-hubzilla-a2b26948d8e472cecd3be6be524b92d86e8f3c4f.zip
duplicate likes if we posted it locally and it also comes back from FB
Diffstat (limited to 'addon/facebook/facebook.php')
-rw-r--r--addon/facebook/facebook.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index d5544601a..cd1ae4aa3 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -733,11 +733,17 @@ function fb_consume_stream($uid,$j,$wall = false) {
if(! $orig_post)
continue;
- $r = q("SELECT * FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `verb` = '%s' AND `author-link` = '%s' LIMIT 1",
+ // If we posted the like locally, it will be found with our url, not the FB url.
+
+ $second_url = (($likes->id == $self_id) ? $self[0]['url'] : 'http://facebook.com/profile.php?id=' . $likes->id);
+
+ $r = q("SELECT * FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `verb` = '%s'
+ AND ( `author-link` = '%s' OR `author-link` = '%s' ) LIMIT 1",
dbesc($orig_post['uri']),
intval($uid),
dbesc(ACTIVITY_LIKE),
- dbesc('http://facebook.com/profile.php?id=' . $likes->id)
+ dbesc('http://facebook.com/profile.php?id=' . $likes->id),
+ dbesc($second_url)
);
if(count($r))