]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/threadednoticelistsubitem.php
Merge branch 'master' into mmn_fixes
[quix0rs-gnu-social.git] / lib / threadednoticelistsubitem.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 // @todo FIXME: needs documentation.
6 class ThreadedNoticeListSubItem extends NoticeListItem
7 {
8     protected $root = null;
9
10     function __construct(Notice $notice, $root, $out)
11     {
12         $this->root = $root;
13         parent::__construct($notice, $out);
14     }
15
16     function avatarSize()
17     {
18         return AVATAR_STREAM_SIZE; // @fixme would like something in between
19     }
20
21     function showNoticeLocation()
22     {
23         //
24     }
25
26     function showNoticeSource()
27     {
28         //
29     }
30
31     function getAttentionProfiles()
32     {
33         $all = parent::getAttentionProfiles();
34
35         $profiles = array();
36
37         $rootAuthor = $this->root->getProfile();
38
39         foreach ($all as $profile) {
40             if ($profile->id != $rootAuthor->id) {
41                 $profiles[] = $profile;
42             }
43         }
44
45         return $profiles;
46     }
47
48     function showEnd()
49     {
50         $threadActive = null;   // unused here for now, but maybe in the future?
51         if (Event::handle('StartShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive))) {
52             // Repeats and Faves/Likes are handled in plugins.
53             Event::handle('EndShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive));
54         }
55         parent::showEnd();
56     }
57 }