summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-05 00:05:11 -0400
committerEvan Prodromou <evan@status.net>2010-09-07 04:00:58 -0400
commitd986537c43ee1500e09f1e6bc49ba00594fe79c3 (patch)
treec3dd044927ae1850f854f9f8b0514997859b07a9 /plugins/TwitterBridge
parent299da9e4624000f5455ffb494cb22714ca57ade7 (diff)
do a uniqueness check before saving new notice-to-status mapping
Diffstat (limited to 'plugins/TwitterBridge')
-rw-r--r--plugins/TwitterBridge/Notice_to_status.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/TwitterBridge/Notice_to_status.php b/plugins/TwitterBridge/Notice_to_status.php
index ecd4905dc..0d94927e4 100644
--- a/plugins/TwitterBridge/Notice_to_status.php
+++ b/plugins/TwitterBridge/Notice_to_status.php
@@ -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;