threadednoticelistsubitem.php 1.3 KB

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