]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
do a uniqueness check before saving new notice-to-status mapping
authorEvan Prodromou <evan@status.net>
Sun, 5 Sep 2010 04:05:11 +0000 (00:05 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 7 Sep 2010 08:00:58 +0000 (04:00 -0400)
plugins/TwitterBridge/Notice_to_status.php

index ecd4905dcc0d2979ee9794c6a0bfc0ecf0be6bd7..0d94927e4271e78bb97654fe39ddd3dd17d97fd5 100644 (file)
@@ -153,6 +153,18 @@ class Notice_to_status extends Memcached_DataObject
 
     static function saveNew($notice_id, $status_id)
     {
+        $n2s = Notice_to_status::staticGet('notice_id', $notice_id);
+
+        if (!empty($n2s)) {
+            return $n2s;
+        }
+
+        $n2s = Notice_to_status::staticGet('status_id', $status_id);
+
+        if (!empty($n2s)) {
+            return $n2s;
+        }
+
         $n2s = new Notice_to_status();
 
         $n2s->notice_id = $notice_id;