From 336f099241c7e68c28c19798f395fcaef0b24a2a Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 2 Jan 2016 16:05:20 +0100 Subject: [PATCH] Don't store object type for verbs (as they don't have it) --- classes/Notice.php | 2 +- plugins/Activity/ActivityPlugin.php | 2 +- plugins/Favorite/FavoritePlugin.php | 1 - plugins/Share/SharePlugin.php | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index ab9d928e64..1afc6d0977 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -90,7 +90,7 @@ class Notice extends Managed_DataObject 'source' => array('type' => 'varchar', 'length' => 32, 'description' => 'source of comment, like "web", "im", or "clientname"'), 'conversation' => array('type' => 'int', 'description' => 'id of root notice in this conversation'), 'repeat_of' => array('type' => 'int', 'description' => 'notice this is a repeat of'), - 'object_type' => array('type' => 'varchar', 'length' => 191, 'description' => 'URI representing activity streams object type', 'default' => 'http://activitystrea.ms/schema/1.0/note'), + 'object_type' => array('type' => 'varchar', 'length' => 191, 'description' => 'URI representing activity streams object type', 'default' => null), 'verb' => array('type' => 'varchar', 'length' => 191, 'description' => 'URI representing activity streams verb', 'default' => 'http://activitystrea.ms/schema/1.0/post'), 'scope' => array('type' => 'int', 'description' => 'bit map for distribution scope; 0 = everywhere; 1 = this server only; 2 = addressees; 4 = followers; null = default'), diff --git a/plugins/Activity/ActivityPlugin.php b/plugins/Activity/ActivityPlugin.php index d8f3c6c502..6805b4fe07 100644 --- a/plugins/Activity/ActivityPlugin.php +++ b/plugins/Activity/ActivityPlugin.php @@ -183,7 +183,7 @@ class ActivityPlugin extends Plugin 'uri' => $uri, 'verb' => ActivityVerb::UNFAVORITE, 'object_type' => (($notice->verb == ActivityVerb::POST) ? - $notice->object_type : ActivityObject::ACTIVITY))); + $notice->object_type : null))); return true; } diff --git a/plugins/Favorite/FavoritePlugin.php b/plugins/Favorite/FavoritePlugin.php index b10a5f06ac..36fa3dc44a 100644 --- a/plugins/Favorite/FavoritePlugin.php +++ b/plugins/Favorite/FavoritePlugin.php @@ -194,7 +194,6 @@ class FavoritePlugin extends ActivityVerbHandlerPlugin $actobj = $act->objects[0]; $object = Fave::saveActivityObject($actobj, $stored); - $stored->object_type = $object->getObjectType(); return $object; } diff --git a/plugins/Share/SharePlugin.php b/plugins/Share/SharePlugin.php index 84174a0440..d1aece5c3d 100644 --- a/plugins/Share/SharePlugin.php +++ b/plugins/Share/SharePlugin.php @@ -128,7 +128,6 @@ class SharePlugin extends ActivityVerbHandlerPlugin // Notice::saveActivity it will update the Notice object. $stored->repeat_of = $sharedNotice->getID(); $stored->conversation = $sharedNotice->conversation; - $stored->object_type = ActivityUtils::resolveUri(ActivityObject::ACTIVITY, true); // We don't have to save a repeat in a separate table, we can // find repeats by just looking at the notice.repeat_of field. -- 2.39.5