{
$context = array();
- $context['replyTo'] = $this->getInReplyToArray();
+ $context['inReplyTo'] = $this->getInReplyToArray();
$context['conversation'] = $this->conversation;
$context['forwardId'] = $this->forwardID;
$context['forwardUrl'] = $this->forwardUrl;
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;
}
}