summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorHue Bastard <hubris@kevin.(none)>2009-12-08 21:28:11 +1000
committerBrion Vibber <brion@status.net>2009-12-11 16:15:22 -0800
commit59e5958d3afa0a5613efbc1ed4546ce63946fe43 (patch)
tree65736eb221001a02bdd5c73db702e3823b60728d /actions
parente2f0fc7b3f459a38c71c730c4006db42cab4724e (diff)
ticket 2055: added logos to Atom and RSS feeds
Diffstat (limited to 'actions')
-rw-r--r--actions/apitimelinefavorites.php6
-rw-r--r--actions/apitimelinefriends.php6
-rw-r--r--actions/apitimelinegroup.php7
-rw-r--r--actions/apitimelinementions.php6
-rw-r--r--actions/apitimelinepublic.php5
-rw-r--r--actions/apitimelinetag.php6
-rw-r--r--actions/apitimelineuser.php6
7 files changed, 28 insertions, 14 deletions
diff --git a/actions/apitimelinefavorites.php b/actions/apitimelinefavorites.php
index f84d7b4cb..77e5cea1b 100644
--- a/actions/apitimelinefavorites.php
+++ b/actions/apitimelinefavorites.php
@@ -101,6 +101,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
function showTimeline()
{
$profile = $this->user->getProfile();
+ $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$sitename = common_config('site', 'name');
$title = sprintf(
@@ -121,20 +122,21 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
$profile->getBestName(),
$this->user->nickname
);
+ $logo = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
switch($this->format) {
case 'xml':
$this->showXmlTimeline($this->notices);
break;
case 'rss':
- $this->showRssTimeline($this->notices, $title, $link, $subtitle);
+ $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $logo, null, $logo);
break;
case 'atom':
$selfuri = common_root_url() .
ltrim($_SERVER['QUERY_STRING'], 'p=');
$this->showAtomTimeline(
$this->notices, $title, $id, $link, $subtitle,
- null, $selfuri
+ null, $selfuri, $logo
);
break;
case 'json':
diff --git a/actions/apitimelinefriends.php b/actions/apitimelinefriends.php
index e84f77372..09ba7a969 100644
--- a/actions/apitimelinefriends.php
+++ b/actions/apitimelinefriends.php
@@ -110,6 +110,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
function showTimeline()
{
$profile = $this->user->getProfile();
+ $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$sitename = common_config('site', 'name');
$title = sprintf(_("%s and friends"), $this->user->nickname);
$taguribase = common_config('integration', 'taguri');
@@ -121,13 +122,14 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
_('Updates from %1$s and friends on %2$s!'),
$this->user->nickname, $sitename
);
+ $logo = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
switch($this->format) {
case 'xml':
$this->showXmlTimeline($this->notices);
break;
case 'rss':
- $this->showRssTimeline($this->notices, $title, $link, $subtitle);
+ $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $logo);
break;
case 'atom':
@@ -144,7 +146,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$this->showAtomTimeline(
$this->notices, $title, $id, $link,
- $subtitle, null, $selfuri
+ $subtitle, null, $selfuri, $logo
);
break;
case 'json':
diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php
index de13e7eb9..22c577f39 100644
--- a/actions/apitimelinegroup.php
+++ b/actions/apitimelinegroup.php
@@ -105,6 +105,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
function showTimeline()
{
$sitename = common_config('site', 'name');
+ $avatar = $this->group->homepage_logo;
$title = sprintf(_("%s timeline"), $this->group->nickname);
$taguribase = common_config('integration', 'taguri');
$id = "tag:$taguribase:GroupTimeline:" . $this->group->id;
@@ -117,13 +118,14 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
$this->group->nickname,
$sitename
);
+ $logo = ($avatar) ? $avatar : User_group::defaultLogo(AVATAR_PROFILE_SIZE);
switch($this->format) {
case 'xml':
$this->showXmlTimeline($this->notices);
break;
case 'rss':
- $this->showRssTimeline($this->notices, $title, $link, $subtitle);
+ $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $logo);
break;
case 'atom':
$selfuri = common_root_url() .
@@ -136,7 +138,8 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
$link,
$subtitle,
null,
- $selfuri
+ $selfuri,
+ $logo
);
break;
case 'json':
diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php
index 0956ccdce..19f40aebc 100644
--- a/actions/apitimelinementions.php
+++ b/actions/apitimelinementions.php
@@ -110,6 +110,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
function showTimeline()
{
$profile = $this->user->getProfile();
+ $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$sitename = common_config('site', 'name');
$title = sprintf(
@@ -126,20 +127,21 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
_('%1$s updates that reply to updates from %2$s / %3$s.'),
$sitename, $this->user->nickname, $profile->getBestName()
);
+ $logo = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
switch($this->format) {
case 'xml':
$this->showXmlTimeline($this->notices);
break;
case 'rss':
- $this->showRssTimeline($this->notices, $title, $link, $subtitle);
+ $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $logo);
break;
case 'atom':
$selfuri = common_root_url() .
ltrim($_SERVER['QUERY_STRING'], 'p=');
$this->showAtomTimeline(
$this->notices, $title, $id, $link, $subtitle,
- null, $selfuri
+ null, $selfuri, $logo
);
break;
case 'json':
diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php
index 7a8504259..633f3c36e 100644
--- a/actions/apitimelinepublic.php
+++ b/actions/apitimelinepublic.php
@@ -103,6 +103,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
function showTimeline()
{
$sitename = common_config('site', 'name');
+ $sitelogo = (common_config('site', 'logo')) ? common_config('site', 'logo') : Theme::path('logo.png');
$title = sprintf(_("%s public timeline"), $sitename);
$taguribase = common_config('integration', 'taguri');
$id = "tag:$taguribase:PublicTimeline";
@@ -114,13 +115,13 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
$this->showXmlTimeline($this->notices);
break;
case 'rss':
- $this->showRssTimeline($this->notices, $title, $link, $subtitle);
+ $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo);
break;
case 'atom':
$selfuri = common_root_url() . 'api/statuses/public_timeline.atom';
$this->showAtomTimeline(
$this->notices, $title, $id, $link,
- $subtitle, null, $selfuri
+ $subtitle, null, $selfuri, $sitelogo
);
break;
case 'json':
diff --git a/actions/apitimelinetag.php b/actions/apitimelinetag.php
index 452593c11..1a50520f4 100644
--- a/actions/apitimelinetag.php
+++ b/actions/apitimelinetag.php
@@ -98,6 +98,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
function showTimeline()
{
$sitename = common_config('site', 'name');
+ $sitelogo = (common_config('site', 'logo')) ? common_config('site', 'logo') : Theme::path('logo.png');
$title = sprintf(_("Notices tagged with %s"), $this->tag);
$link = common_local_url(
'tag',
@@ -116,7 +117,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
$this->showXmlTimeline($this->notices);
break;
case 'rss':
- $this->showRssTimeline($this->notices, $title, $link, $subtitle);
+ $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo);
break;
case 'atom':
$selfuri = common_root_url() .
@@ -129,7 +130,8 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
$link,
$subtitle,
null,
- $selfuri
+ $selfuri,
+ $sitelogo
);
break;
case 'json':
diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php
index ca1d21772..14c62a52e 100644
--- a/actions/apitimelineuser.php
+++ b/actions/apitimelineuser.php
@@ -112,6 +112,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
function showTimeline()
{
$profile = $this->user->getProfile();
+ $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$sitename = common_config('site', 'name');
$title = sprintf(_("%s timeline"), $this->user->nickname);
@@ -125,6 +126,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
_('Updates from %1$s on %2$s!'),
$this->user->nickname, $sitename
);
+ $logo = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
// FriendFeed's SUP protocol
// Also added RSS and Atom feeds
@@ -139,7 +141,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
case 'rss':
$this->showRssTimeline(
$this->notices, $title, $link,
- $subtitle, $suplink
+ $subtitle, $suplink, $logo
);
break;
case 'atom':
@@ -153,7 +155,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
}
$this->showAtomTimeline(
$this->notices, $title, $id, $link,
- $subtitle, $suplink, $selfuri
+ $subtitle, $suplink, $selfuri, $logo
);
break;
case 'json':