Show inline repeats-list in ThreadedNoticeList
Also, don't show repeats _as_ separate notices in the list either.
This commit is contained in:
parent
a900d04052
commit
167740456b
|
@ -70,7 +70,7 @@ class NoticeListItem extends Widget
|
||||||
parent::__construct($out);
|
parent::__construct($out);
|
||||||
if (!empty($notice->repeat_of)) {
|
if (!empty($notice->repeat_of)) {
|
||||||
$original = Notice::getKV('id', $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;
|
$this->notice = $notice;
|
||||||
} else {
|
} else {
|
||||||
$this->notice = $original;
|
$this->notice = $original;
|
||||||
|
|
|
@ -89,7 +89,7 @@ class ThreadedNoticeList extends NoticeList
|
||||||
|
|
||||||
if ($notice->repeat_of) {
|
if ($notice->repeat_of) {
|
||||||
$orig = Notice::getKV('id', $notice->repeat_of);
|
$orig = Notice::getKV('id', $notice->repeat_of);
|
||||||
if ($orig) {
|
if ($orig instanceof Notice) {
|
||||||
$notice = $orig;
|
$notice = $orig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ class ThreadedNoticeList extends NoticeList
|
||||||
|
|
||||||
// Get the convo's root notice
|
// Get the convo's root notice
|
||||||
$root = $notice->conversationRoot($this->userProfile);
|
$root = $notice->conversationRoot($this->userProfile);
|
||||||
if ($root) {
|
if ($root instanceof Notice) {
|
||||||
$notice = $root;
|
$notice = $root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,6 +208,11 @@ class ThreadedNoticeListItem extends NoticeListItem
|
||||||
$moreCutoff = null;
|
$moreCutoff = null;
|
||||||
while ($notice->fetch()) {
|
while ($notice->fetch()) {
|
||||||
if (Event::handle('StartAddNoticeReply', array($this, $this->notice, $notice))) {
|
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) {
|
if ($notice->id == $this->notice->id) {
|
||||||
// Skip!
|
// Skip!
|
||||||
continue;
|
continue;
|
||||||
|
@ -316,6 +321,8 @@ class ThreadedNoticeListSubItem extends NoticeListItem
|
||||||
{
|
{
|
||||||
$item = new ThreadedNoticeListInlineFavesItem($this->notice, $this->out);
|
$item = new ThreadedNoticeListInlineFavesItem($this->notice, $this->out);
|
||||||
$hasFaves = $item->show();
|
$hasFaves = $item->show();
|
||||||
|
$item = new ThreadedNoticeListInlineRepeatsItem($this->notice, $this->out);
|
||||||
|
$hasRepeats = $item->show();
|
||||||
parent::showEnd();
|
parent::showEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -551,7 +558,7 @@ class ThreadedNoticeListInlineFavesItem extends ThreadedNoticeListFavesItem
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Placeholder for showing faves...
|
* Placeholder for showing repeats...
|
||||||
*/
|
*/
|
||||||
class ThreadedNoticeListRepeatsItem extends NoticeListActorsItem
|
class ThreadedNoticeListRepeatsItem extends NoticeListActorsItem
|
||||||
{
|
{
|
||||||
|
@ -612,3 +619,17 @@ class ThreadedNoticeListRepeatsItem extends NoticeListActorsItem
|
||||||
$this->out->elementEnd('li');
|
$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');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user