]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/actions/pushhub.php
OStatus support for people tags
[quix0rs-gnu-social.git] / plugins / OStatus / actions / pushhub.php
index 68035ab5cc20aaad6e6a760e0aeb6154e18e8a2c..e7716c8cd03b9c05f6eceb3c6f0f1fd38bae422c 100644 (file)
  * @maintainer Brion Vibber <brion@status.net>
  */
 
+if (!defined('STATUSNET')) {
+    exit(1);
+}
+
 /**
 
 
@@ -172,7 +176,22 @@ class PushHubAction extends Action
                     return true;
                 }
             }
-            common_log(LOG_DEBUG, "Not a user or group feed? $feed $userFeed $groupFeed");
+        } else if (preg_match('!/(\d+)/lists/(\d+)/statuses\.atom$!', $feed, $matches)) {
+            $user = $matches[1];
+            $id = $matches[2];
+            $params = array('user' => $user, 'id' => $id, 'format' => 'atom');
+            $listFeed = common_local_url('ApiTimelineList', $params);
+
+            if ($feed == $listFeed) {
+                $list = Profile_list::staticGet('id', $id);
+                $user = User::staticGet('id', $user);
+                if (!$list || !$user || $list->tagger != $user->id) {
+                    throw new ClientException("Invalid hub.topic $feed; people tag doesn't exist.");
+                } else {
+                    return true;
+                }
+            }
+            common_log(LOG_DEBUG, "Not a user, group or people tag feed? $feed $userFeed $groupFeed $listFeed");
         }
         common_log(LOG_DEBUG, "LOST $feed");
         return false;