threadednoticelistsubitem.php 1.3 KB

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