From 2c677e0f2d881f0c9f5713fcbc37ad24ef0dab26 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 1 Mar 2010 18:49:39 -0500 Subject: Revert "show service debug info" This reverts commit 19ec0e3a62d4c60d7e5581b4e38ec705650b1d18. --- lib/omb.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/omb.php b/lib/omb.php index 8bbe5e8aa..db60fa0ef 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -144,9 +144,6 @@ function omb_broadcast_profile($profile) $service = new StatusNet_OMB_Service_Consumer( array(OMB_ENDPOINT_UPDATEPROFILE => $rp->updateprofileurl), $rp->uri); - - common_debug('service = ' . print_r($service, true)); - try { $service->setToken($rp->token, $rp->secret); $service->updateProfile($omb_profile); -- cgit v1.2.3-54-g00ecf From c25fc8a4b51466f13c41efc0565bf15f78f6cb4d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 2 Mar 2010 02:54:52 -0500 Subject: Show and no activity actors for user feed We only need one author for user feeds: the user themselves. So, show the user as the activity:subject, and don't repeat the same activity:actor for every notice unnecessarily. --- classes/Notice.php | 8 +++++--- lib/atomnoticefeed.php | 16 +++++++++++++--- lib/atomusernoticefeed.php | 11 +++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 3702dbcfa..4b5dbb416 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1090,7 +1090,7 @@ class Notice extends Memcached_DataObject return $groups; } - function asAtomEntry($namespace=false, $source=false) + function asAtomEntry($namespace=false, $source=false, $author=true) { $profile = $this->getProfile(); @@ -1136,8 +1136,10 @@ class Notice extends Memcached_DataObject $xs->element('title', null, $this->content); $xs->element('summary', null, $this->content); - $xs->raw($profile->asAtomAuthor()); - $xs->raw($profile->asActivityActor()); + if ($author) { + $xs->raw($profile->asAtomAuthor()); + $xs->raw($profile->asActivityActor()); + } $xs->element('link', array('rel' => 'alternate', 'type' => 'text/html', diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php index 3c3556cb9..e4df731fe 100644 --- a/lib/atomnoticefeed.php +++ b/lib/atomnoticefeed.php @@ -107,9 +107,19 @@ class AtomNoticeFeed extends Atom10Feed */ function addEntryFromNotice($notice) { - $this->addEntryRaw($notice->asAtomEntry()); - } + $source = $this->showSource(); + $author = $this->showAuthor(); -} + $this->addEntryRaw($notice->asAtomEntry(false, $source, $author)); + } + function showSource() + { + return true; + } + function showAuthor() + { + return true; + } +} diff --git a/lib/atomusernoticefeed.php b/lib/atomusernoticefeed.php index 2ad8de455..6485aaa43 100644 --- a/lib/atomusernoticefeed.php +++ b/lib/atomusernoticefeed.php @@ -61,6 +61,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed if (!empty($user)) { $profile = $user->getProfile(); $this->addAuthor($profile->nickname, $user->uri); + $this->setActivitySubject($profile->asActivityNoun('subject')); } } @@ -68,4 +69,14 @@ class AtomUserNoticeFeed extends AtomNoticeFeed { return $this->user; } + + function showSource() + { + return false; + } + + function showAuthor() + { + return false; + } } -- cgit v1.2.3-54-g00ecf From 40ac7247979dc6f33f56b20c907d55deb6b9c815 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 2 Mar 2010 03:13:05 -0500 Subject: don't duplicate title in summary in Atom output per RFC4287 4.2.13 --- classes/Notice.php | 1 - 1 file changed, 1 deletion(-) diff --git a/classes/Notice.php b/classes/Notice.php index 4b5dbb416..c31d8bd69 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1134,7 +1134,6 @@ class Notice extends Memcached_DataObject } $xs->element('title', null, $this->content); - $xs->element('summary', null, $this->content); if ($author) { $xs->raw($profile->asAtomAuthor()); -- cgit v1.2.3-54-g00ecf