From 9f75131082ad282a59bc9de1c8ad82f5e3c79956 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 31 Aug 2011 15:25:06 -0400 Subject: [PATCH 1/3] check for 'post' verb in microapps by default --- lib/microappplugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/microappplugin.php b/lib/microappplugin.php index a723ecde42..11058ad1ac 100644 --- a/lib/microappplugin.php +++ b/lib/microappplugin.php @@ -175,7 +175,7 @@ abstract class MicroAppPlugin extends Plugin */ function isMyNotice($notice) { $types = $this->types(); - return in_array($notice->object_type, $types); + return ($notice->verb == ActivityVerb::POST) && in_array($notice->object_type, $types); } /** @@ -194,6 +194,7 @@ abstract class MicroAppPlugin extends Plugin $types = $this->types(); return (count($activity->objects) == 1 && ($activity->objects[0] instanceof ActivityObject) && + ($activity->verb == ActivityVerb::POST) && in_array($activity->objects[0]->type, $types)); } From c585a43d6f55070f9e3f2ad163bda256984fda6f Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 31 Aug 2011 13:09:52 -0700 Subject: [PATCH 2/3] Remove activity:actor and deprecation warning from Atom Activity Streams serialization --- lib/activity.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/activity.php b/lib/activity.php index 9dbb0e2ee0..5234a54c03 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -570,18 +570,6 @@ class Activity if ($author) { $this->actor->outputTo($xs, 'author'); - - // XXX: Remove ASAP! Author information - // has been moved to the author element in the Activity - // Streams spec. We're outputting actor only for backward - // compatibility with clients that can only parse - // activities based on older versions of the spec. - - $depMsg = 'Deprecation warning: activity:actor is present ' - . 'only for backward compatibility. It will be ' - . 'removed in the next version of StatusNet.'; - $xs->comment($depMsg); - $this->actor->outputTo($xs, 'activity:actor'); } if ($this->verb != ActivityVerb::POST || count($this->objects) != 1 || $tag != 'entry') { From 5f441842be6868d8fed156896da387466a5d7ec0 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 31 Aug 2011 13:10:12 -0700 Subject: [PATCH 3/3] Fix warning / send current user in to Notice::asActivity --- plugins/Activity/ActivityPlugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Activity/ActivityPlugin.php b/plugins/Activity/ActivityPlugin.php index b3c3817858..5801c194a6 100644 --- a/plugins/Activity/ActivityPlugin.php +++ b/plugins/Activity/ActivityPlugin.php @@ -374,7 +374,8 @@ class ActivityPlugin extends Plugin if (!empty($fave)) { $notice = Notice::staticGet('id', $fave->notice_id); if (!empty($notice)) { - $target = $notice->asActivity(); + $cur = common_current_user(); + $target = $notice->asActivity($cur); if ($target->verb == ActivityVerb::POST) { // "I like the thing you posted" $activity->objects = $target->objects;