From 2dfd34b12df1eb4c9e4bf464250a3d34bca8801d Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 9 Oct 2015 16:18:12 +0200 Subject: [PATCH] Post verb default type is 'note' --- classes/Notice.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/classes/Notice.php b/classes/Notice.php index b5dd1fd79b..29125c6d83 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -885,6 +885,15 @@ class Notice extends Managed_DataObject $urls[] = $href; } + if (ActivityUtils::compareVerbs($stored->verb, array(ActivityVerb::POST))) { + $stored->object_type = $act->type ?: $act->objects[0]->type; + if (empty($stored->object_type)) { + // Default type for the post verb is 'note', but we know it's + // a 'comment' if it is in reply to something. + $stored->object_type = empty($stored->reply_to) ? ActivityObject::NOTE : ActivityObject::COMMENT; + } + } + if (Event::handle('StartNoticeSave', array(&$stored))) { // XXX: some of these functions write to the DB -- 2.39.5