]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
change PuSH plugin to use whoGets()
authorEvan Prodromou <evan@status.net>
Sat, 9 Jan 2010 21:59:39 +0000 (13:59 -0800)
committerEvan Prodromou <evan@status.net>
Sat, 9 Jan 2010 21:59:39 +0000 (13:59 -0800)
plugins/PubSubHubBub/PubSubHubBubPlugin.php

index d15a869cba3b9f967736cb73e5f357f64cd5d4be..d9c047de85ed1761b78571208d08f6a89fb9d298 100644 (file)
@@ -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