]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show <activity:subject> in Atom group notice feed
authorEvan Prodromou <evan@status.net>
Wed, 29 Dec 2010 23:33:57 +0000 (15:33 -0800)
committerEvan Prodromou <evan@status.net>
Wed, 29 Dec 2010 23:33:57 +0000 (15:33 -0800)
Version 0.9.6 and below of StatusNet assume anything in <author> is a
Person. So, we include an <activity:subject> element, which will be
checked first by those versions of the code, only for group feeds.

At some point we'll take this out, but it's useful for now.

lib/atomgroupnoticefeed.php

index 5b6fcf42952b1e24ee255234b16157907b8cfb07..4e7f992662d53657fa6677018a902fdbe0dbb71d 100644 (file)
@@ -85,9 +85,14 @@ class AtomGroupNoticeFeed extends AtomNoticeFeed
         $this->setId($self);
         $this->setSelfLink($self);
 
+        // For groups, we generate an author _AND_ an <activity:subject>
+        // Versions of StatusNet under 0.9.7 treat <author> as a person
+        // XXX: remove this workaround in future versions
+
         $ao = ActivityObject::fromGroup($group);
 
-        $this->addAuthorRaw($ao->asString('author'));
+        $this->addAuthorRaw($ao->asString('author').
+                            $ao->asString('activity:subject'));
 
         $this->addLink($group->homeUrl());
     }