]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add activity:subject to atom feeds
authorEvan Prodromou <evan@status.net>
Sun, 21 Feb 2010 18:11:00 +0000 (13:11 -0500)
committerEvan Prodromou <evan@status.net>
Sun, 21 Feb 2010 18:11:00 +0000 (13:11 -0500)
plugins/OStatus/OStatusPlugin.php

index 3aaa769db46bd74e90e8685a1fa14cf9c0347260..b5cfb5caec4684aa6a20ba2355fae981b9037c09 100644 (file)
@@ -102,16 +102,21 @@ class OStatusPlugin extends Plugin
         $id = null;
 
         if ($feed instanceof AtomUserNoticeFeed) {
-            $salmonAction = 'salmon';
-            $id = $feed->getUser()->id;
+            $salmonAction = 'usersalmon';
+            $user = $feed->getUser();
+            $id   = $user->id;
+            $profile = $user->getProfile();
+            $feed->setActivitySubject($profile->asActivityNoun('subject'));
         } else if ($feed instanceof AtomGroupNoticeFeed) {
-            $salmonAction = 'salmongroup';
-            $id = $feed->getGroup()->id;
+            $salmonAction = 'groupsalmon';
+            $group = $feed->getGroup();
+            $id = $group->id;
+            $feed->setActivitySubject($group->asActivitySubject());
         } else {
-            return;
+            return true;
         }
 
-       if (!empty($id)) {
+        if (!empty($id)) {
             $hub = common_config('ostatus', 'hub');
             if (empty($hub)) {
                 // Updates will be handled through our internal PuSH hub.
@@ -123,6 +128,8 @@ class OStatusPlugin extends Plugin
             $salmon = common_local_url($salmonAction, array('id' => $id));
             $feed->addLink($salmon, array('rel' => 'salmon'));
         }
+
+        return true;
     }
 
     /**