GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit 93e3d490 authored by Zach Copley's avatar Zach Copley

Activity Streams JSON: inReplyTo objects weren't being output. Fixed.

parent b741184d
......@@ -142,7 +142,7 @@ class ActivityContext
{
$context = array();
$context['replyTo'] = $this->getInReplyToArray();
$context['inReplyTo'] = $this->getInReplyToArray();
$context['conversation'] = $this->conversation;
$context['forwardId'] = $this->forwardID;
$context['forwardUrl'] = $this->forwardUrl;
......@@ -178,20 +178,31 @@ class ActivityContext
return $tos;
}
/*
* Show replyTo
/**
* Return an array for the notices this notice is a reply to
* suitable for serializing as JSON note objects.
*
* @return array the array of notes
*/
function getInReplyToArray()
{
$replyToObj = array('objectType' => 'note');
if (empty($this->replyToID) && empty($this->replyToUrl)) {
return null;
}
$replyToObj['id'] = $this->replyToID;
$replyToObj = array('objectType' => 'note');
// XXX: Possibly shorten this to just the numeric ID?
// Currently, it's the full URI of the notice.
if (!empty($this->replyToID)) {
$replyToObj['id'] = $this->replyToID;
}
if (!empty($this->replyToUrl)) {
$replyToObj['url'] = $this->replyToUrl;
}
return $replyToObj;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment