summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-22 16:44:19 -0800
committerEvan Prodromou <evan@status.net>2009-12-22 16:44:19 -0800
commitf6bf9529805cd58fdd1671dd9b133bde05e8ae87 (patch)
treecf272bd1105da48f016b635db4d9c34810adcbda /plugins/TwitterBridge/daemons/twitterstatusfetcher.php
parentf987273f118a12d443b6789c2ab59d7a4b01f678 (diff)
parent30c2e2ce83282f0bc268153d7ec465fbb5cf00ca (diff)
Merge branch 'testing'
Diffstat (limited to 'plugins/TwitterBridge/daemons/twitterstatusfetcher.php')
-rwxr-xr-xplugins/TwitterBridge/daemons/twitterstatusfetcher.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
index eba1d563b..b4ca12be2 100755
--- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
+++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
@@ -209,7 +209,13 @@ class TwitterStatusFetcher extends ParallelizingDaemon
continue;
}
- $this->saveStatus($status, $flink);
+ $notice = null;
+
+ $notice = $this->saveStatus($status, $flink);
+
+ if (!empty($notice)) {
+ common_broadcast_notice($notice);
+ }
}
// Okay, record the time we synced with Twitter for posterity
@@ -235,12 +241,14 @@ class TwitterStatusFetcher extends ParallelizingDaemon
$uri = 'http://twitter.com/' . $status->user->screen_name .
'/status/' . $status->id;
- $notice = Notice::staticGet('uri', $uri);
-
// check to see if we've already imported the status
+ $notice = Notice::staticGet('uri', $uri);
+
if (empty($notice)) {
+ // XXX: transaction here?
+
$notice = new Notice();
$notice->profile_id = $id;
@@ -257,6 +265,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
$id = $notice->insert();
Event::handle('EndNoticeSave', array($notice));
}
+
}
if (!Notice_inbox::pkeyGet(array('notice_id' => $notice->id,
@@ -270,7 +279,12 @@ class TwitterStatusFetcher extends ParallelizingDaemon
$inbox->source = NOTICE_INBOX_SOURCE_GATEWAY; // From a private source
$inbox->insert();
+
}
+
+ $notice->blowCaches();
+
+ return $notice;
}
function ensureProfile($user)