]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
TwitterBridge also check for dupe by uri
authorStephen Paul Weber <singpolyma@singpolyma.net>
Fri, 23 Oct 2015 18:03:44 +0000 (18:03 +0000)
committerStephen Paul Weber <singpolyma@singpolyma.net>
Fri, 23 Oct 2015 18:03:44 +0000 (18:03 +0000)
In case a twitter item came in from some other source (such as linkback).

plugins/TwitterBridge/lib/twitterimport.php

index d929fecf83291deff3b5b218cce37a1e1c7485a1..5b0c34d9d7ad1a075e220f1c2dc8db3fc7363f6f 100644 (file)
@@ -102,6 +102,17 @@ class TwitterImport
             return Notice::getKV('id', $n2s->notice_id);
         }
 
+        $dupe = Notice::getKV('uri', $statusUri);
+        if($dupe instanceof Notice) {
+            // Add it to our record
+            Notice_to_status::saveNew($dupe->id, $statusId);
+            common_log(
+                LOG_INFO,
+                __METHOD__ . " - Ignoring duplicate import: {$statusId}"
+            );
+            return $dupe;
+        }
+
         // If it's a retweet, save it as a repeat!
         if (!empty($status->retweeted_status)) {
             common_log(LOG_INFO, "Status {$statusId} is a retweet of " . twitter_id($status->retweeted_status) . ".");