return $result;
}
+ public function getUri()
+ {
+ return $this->uri;
+ }
+
/**
* Extract #hashtags from this notice's content and save them to the database.
*/
$repeat = Notice::getKV('id', $repeat_of);
- if (empty($repeat)) {
+ if (!($repeat instanceof Notice)) {
// TRANS: Client exception thrown in notice when trying to repeat a missing or deleted notice.
throw new ClientException(_('Cannot repeat; original notice is missing or deleted.'));
}
throw new ClientException(_('Cannot repeat a notice you cannot read.'), 403);
}
- if ($profile->hasRepeated($repeat->id)) {
+ if ($profile->hasRepeated($repeat)) {
// TRANS: Client error displayed when trying to repeat an already repeated notice.
throw new ClientException(_('You already repeated that notice.'));
}
try {
$parent = $last->getParent();
if ($parent->inScope($profile)) {
- common_debug(__METHOD__ . 'Parent of '.$last->id.' is '.$parent->id);
$last = $parent;
continue;
}
} catch (Exception $e) {
// Latest notice has no parent
- common_debug(__METHOD__ . 'Found no parent for '.$last->id);
}
// No parent, or parent out of scope
$root = $last;
// favorite and repeated
if (!empty($cur)) {
- $noticeInfoAttr['favorite'] = ($cur->hasFave($this)) ? "true" : "false";
$cp = $cur->getProfile();
- $noticeInfoAttr['repeated'] = ($cp->hasRepeated($this->id)) ? "true" : "false";
+ $noticeInfoAttr['favorite'] = ($cp->hasFave($this)) ? "true" : "false";
+ $noticeInfoAttr['repeated'] = ($cp->hasRepeated($this)) ? "true" : "false";
}
if (!empty($this->repeat_of)) {