]> git.mxchange.org Git - friendica.git/commitdiff
duplicate likes if we posted it locally and it also comes back from FB
authorFriendika <info@friendika.com>
Fri, 27 May 2011 22:33:01 +0000 (15:33 -0700)
committerFriendika <info@friendika.com>
Fri, 27 May 2011 22:33:01 +0000 (15:33 -0700)
addon/facebook/facebook.php
boot.php

index d5544601aa8ff1f67fa13c96197c0e98cd6181f2..cd1ae4aa33d980c8162534e7c1a1b0fd9a3d4589 100644 (file)
@@ -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))
index 104e20f56d5ead4b7f8c54e03ec573776c2ee149..af16e8cbbf8058a086d7db2e7262e3a661775d63 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -4,7 +4,7 @@ set_time_limit(0);
 ini_set('pcre.backtrack_limit', 250000);
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.992' );
+define ( 'FRIENDIKA_VERSION',      '2.2.993' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1058      );