From 0a5e1f2d88f8841dac65e2cd0e3bc0b12ef79501 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 5 Sep 2010 00:05:11 -0400 Subject: [PATCH] do a uniqueness check before saving new notice-to-status mapping --- plugins/TwitterBridge/Notice_to_status.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/TwitterBridge/Notice_to_status.php b/plugins/TwitterBridge/Notice_to_status.php index ecd4905dcc..0d94927e42 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; -- 2.39.5