parent::__construct($out);
if (!empty($notice->repeat_of)) {
$original = Notice::getKV('id', $notice->repeat_of);
- if (empty($original)) { // could have been deleted
+ if (!$original instanceof Notice) { // could have been deleted
$this->notice = $notice;
} else {
$this->notice = $original;
if ($notice->repeat_of) {
$orig = Notice::getKV('id', $notice->repeat_of);
- if ($orig) {
+ if ($orig instanceof Notice) {
$notice = $orig;
}
}
// Get the convo's root notice
$root = $notice->conversationRoot($this->userProfile);
- if ($root) {
+ if ($root instanceof Notice) {
$notice = $root;
}
$moreCutoff = null;
while ($notice->fetch()) {
if (Event::handle('StartAddNoticeReply', array($this, $this->notice, $notice))) {
+ // Don't list repeats as separate notices in a conversation
+ if (!empty($notice->repeat_of)) {
+ continue;
+ }
+
if ($notice->id == $this->notice->id) {
// Skip!
continue;
{
$item = new ThreadedNoticeListInlineFavesItem($this->notice, $this->out);
$hasFaves = $item->show();
+ $item = new ThreadedNoticeListInlineRepeatsItem($this->notice, $this->out);
+ $hasRepeats = $item->show();
parent::showEnd();
}
}
}
/**
- * Placeholder for showing faves...
+ * Placeholder for showing repeats...
*/
class ThreadedNoticeListRepeatsItem extends NoticeListActorsItem
{
$this->out->elementEnd('li');
}
}
+
+// @todo FIXME: needs documentation.
+class ThreadedNoticeListInlineRepeatsItem extends ThreadedNoticeListRepeatsItem
+{
+ function showStart()
+ {
+ $this->out->elementStart('div', array('class' => 'entry-content notice-repeats'));
+ }
+
+ function showEnd()
+ {
+ $this->out->elementEnd('div');
+ }
+}