diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/PubSubHubBub/PubSubHubBubPlugin.php | 16 | ||||
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 11 | ||||
-rwxr-xr-x | plugins/TwitterBridge/daemons/twitterstatusfetcher.php | 14 |
3 files changed, 14 insertions, 27 deletions
diff --git a/plugins/PubSubHubBub/PubSubHubBubPlugin.php b/plugins/PubSubHubBub/PubSubHubBubPlugin.php index c40d906a5..367b35403 100644 --- a/plugins/PubSubHubBub/PubSubHubBubPlugin.php +++ b/plugins/PubSubHubBub/PubSubHubBubPlugin.php @@ -95,14 +95,16 @@ class PubSubHubBubPlugin extends Plugin } //feed of each user that subscribes to the notice's author - $notice_inbox = new Notice_inbox(); - $notice_inbox->notice_id = $notice->id; - if ($notice_inbox->find()) { - while ($notice_inbox->fetch()) { - $user = User::staticGet('id',$notice_inbox->user_id); - $feeds[]=common_local_url('ApiTimelineUser',array('id' => $user->nickname, 'format'=>'rss')); - $feeds[]=common_local_url('ApiTimelineUser',array('id' => $user->nickname, 'format'=>'atom')); + + $ni = $notice->whoGets(); + + foreach (array_keys($ni) as $user_id) { + $user = User::staticGet('id', $user_id); + if (empty($user)) { + continue; } + $feeds[]=common_local_url('ApiTimelineUser',array('id' => $user->nickname, 'format'=>'rss')); + $feeds[]=common_local_url('ApiTimelineUser',array('id' => $user->nickname, 'format'=>'atom')); } //feed of user replied to diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 21e465b53..89640f5be 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -154,14 +154,11 @@ class RealtimePlugin extends Plugin // Add to inbox timelines // XXX: do a join - $inbox = new Notice_inbox(); - $inbox->notice_id = $notice->id; + $ni = $notice->whoGets(); - if ($inbox->find()) { - while ($inbox->fetch()) { - $user = User::staticGet('id', $inbox->user_id); - $paths[] = array('all', $user->nickname); - } + foreach (array_keys($ni) as $user_id) { + $user = User::staticGet('id', $user_id); + $paths[] = array('all', $user->nickname); } // Add to the replies timeline diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php index b4ca12be2..36732ce46 100755 --- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php +++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php @@ -268,19 +268,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon } - if (!Notice_inbox::pkeyGet(array('notice_id' => $notice->id, - 'user_id' => $flink->user_id))) { - // Add to inbox - $inbox = new Notice_inbox(); - - $inbox->user_id = $flink->user_id; - $inbox->notice_id = $notice->id; - $inbox->created = $notice->created; - $inbox->source = NOTICE_INBOX_SOURCE_GATEWAY; // From a private source - - $inbox->insert(); - - } + Inbox::insertNotice($flink->user_id, $notice->id); $notice->blowCaches(); |