From f3a82e787c70e8cf749c79f22fe37ce6c9c9d4d3 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 12 Feb 2010 19:00:35 -0800 Subject: Add OStatus PuSH hub and Salmon links back into user and group feeds --- actions/apitimelinegroup.php | 14 +++++++++++++- actions/apitimelineuser.php | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index 45962fa76..3c74e36b5 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.php @@ -138,7 +138,19 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction try { - $atom = new AtomNoticeFeed(); + // If this was called using an integer ID, i.e.: using the canonical + // URL for this group's feed, then pass the Group object into the feed, + // so the OStatus plugin, and possibly other plugins, can access it. + // Feels sorta hacky. -- Z + + $atom = null; + $id = $this->arg('id'); + + if (strval(intval($id)) === strval($id)) { + $atom = new AtomGroupNoticeFeed($this->group); + } else { + $atom = new AtomGroupNoticeFeed(); + } $atom->setId($id); $atom->setTitle($title); diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index d20bb0d20..24752e45f 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -148,7 +148,19 @@ class ApiTimelineUserAction extends ApiBareAuthAction header('Content-Type: application/atom+xml; charset=utf-8'); - $atom = new AtomNoticeFeed(); + // If this was called using an integer ID, i.e.: using the canonical + // URL for this user's feed, then pass the User object into the feed, + // so the OStatus plugin, and possibly other plugins, can access it. + // Feels sorta hacky. -- Z + + $atom = null; + $id = $this->arg('id'); + + if (strval(intval($id)) === strval($id)) { + $atom = new AtomUserNoticeFeed($this->user); + } else { + $atom = new AtomUserNoticeFeed(); + } $atom->setId($id); $atom->setTitle($title); -- cgit v1.2.3-54-g00ecf