3 * @file src/Object/Post.php
5 namespace Friendica\Object;
7 use Friendica\BaseObject;
8 use Friendica\Content\ContactSelector;
9 use Friendica\Content\Feature;
10 use Friendica\Core\Addon;
11 use Friendica\Core\Config;
12 use Friendica\Core\Hook;
13 use Friendica\Core\L10n;
14 use Friendica\Core\Logger;
15 use Friendica\Core\PConfig;
16 use Friendica\Core\Protocol;
17 use Friendica\Core\Renderer;
18 use Friendica\Core\Session;
19 use Friendica\Database\DBA;
20 use Friendica\Model\Contact;
21 use Friendica\Model\Item;
22 use Friendica\Model\Term;
23 use Friendica\Model\User;
24 use Friendica\Util\Crypto;
25 use Friendica\Util\DateTimeFormat;
26 use Friendica\Util\Proxy as ProxyUtils;
27 use Friendica\Util\Strings;
28 use Friendica\Util\Temporal;
33 class Post extends BaseObject
36 private $template = null;
37 private $available_templates = [
38 'wall' => 'wall_thread.tpl',
39 'wall2wall' => 'wallwall_thread.tpl'
41 private $comment_box_template = 'comment_item.tpl';
42 private $toplevel = false;
43 private $writable = false;
47 private $children = [];
48 private $parent = null;
53 private $thread = null;
54 private $redirect_url = null;
55 private $owner_url = '';
56 private $owner_photo = '';
57 private $owner_name = '';
58 private $wall_to_wall = false;
59 private $threaded = false;
60 private $visiting = false;
65 * @param array $data data array
68 public function __construct(array $data)
71 $this->setTemplate('wall');
72 $this->toplevel = $this->getId() == $this->getDataValue('parent');
74 if (!empty($_SESSION['remote']) && is_array($_SESSION['remote'])) {
75 foreach ($_SESSION['remote'] as $visitor) {
76 if ($visitor['cid'] == $this->getDataValue('contact-id')) {
77 $this->visiting = true;
83 $this->writable = $this->getDataValue('writable') || $this->getDataValue('self');
84 $author = ['uid' => 0, 'id' => $this->getDataValue('author-id'),
85 'network' => $this->getDataValue('author-network'),
86 'url' => $this->getDataValue('author-link')];
87 $this->redirect_url = Contact::magicLinkByContact($author);
88 if (!$this->isToplevel()) {
89 $this->threaded = true;
92 // Prepare the children
93 if (!empty($data['children'])) {
94 foreach ($data['children'] as $item) {
95 // Only add will be displayed
96 if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) {
98 } elseif (!visible_activity($item)) {
102 // You can always comment on Diaspora and OStatus items
103 if (in_array($item['network'], [Protocol::OSTATUS, Protocol::DIASPORA]) && (local_user() == $item['uid'])) {
104 $item['writable'] = true;
107 $item['pagedrop'] = $data['pagedrop'];
108 $child = new Post($item);
109 $this->addChild($child);
115 * Get data in a form usable by a conversation template
117 * @param array $conv_responses conversation responses
118 * @param integer $thread_level default = 1
120 * @return mixed The data requested on success
122 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
123 * @throws \ImagickException
125 public function getTemplateData(array $conv_responses, $thread_level = 1)
129 $item = $this->getData();
131 // If the time between "created" and "edited" differs we add
132 // a notice that the post was edited.
133 // Note: In some networks reshared items seem to have (sometimes) a difference
134 // between creation time and edit time of a second. Thats why we add the notice
135 // only if the difference is more than 1 second.
136 if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
138 'label' => L10n::t('This entry was edited'),
139 'date' => DateTimeFormat::local($item['edited'], 'r'),
140 'relative' => Temporal::getRelativeDate($item['edited'])
148 $isstarred = "unstarred";
152 $total_children = $this->countDescendants();
154 $conv = $this->getThread();
156 $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
157 || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
158 ? L10n::t('Private Message')
161 $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
166 if (Strings::compareLink($a->contact['url'], $item['author-link'])) {
167 if ($item["event-id"] != 0) {
168 $edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
170 $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
173 $dropping = in_array($item['uid'], [0, local_user()]);
176 // Editing on items of not subscribed users isn't currently possible
177 // There are some issues on editing that prevent this.
178 // But also it is an issue of the supported protocols that doesn't allow editing at all.
179 if ($item['uid'] == 0) {
183 if (($this->getDataValue('uid') == local_user()) || $this->isVisiting()) {
187 $origin = $item['origin'];
190 /// @todo This shouldn't be done as query here, but better during the data creation.
191 // it is now done here, since during the RC phase we shouldn't make to intense changes.
192 $parent = Item::selectFirst(['origin'], ['id' => $item['parent']]);
193 if (DBA::isResult($parent)) {
194 $origin = $parent['origin'];
198 if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
199 // ActivityPub doesn't allow removal of remote comments
200 $delete = L10n::t('Delete locally');
202 // Showing the one or the other text, depending upon if we can only hide it or really delete it.
203 $delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally');
207 'dropping' => $dropping,
208 'pagedrop' => $item['pagedrop'],
209 'select' => L10n::t('Select'),
217 $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
219 $profile_name = $item['author-name'];
220 if (!empty($item['author-link']) && empty($item['author-name'])) {
221 $profile_name = $item['author-link'];
224 $author = ['uid' => 0, 'id' => $item['author-id'],
225 'network' => $item['author-network'], 'url' => $item['author-link']];
227 if (local_user() || remote_user()) {
228 $profile_link = Contact::magicLinkByContact($author);
230 $profile_link = $item['author-link'];
233 if (strpos($profile_link, 'redir/') === 0) {
234 $sparkle = ' sparkle';
237 $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
238 Hook::callAll('render_location', $locate);
239 $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
241 // process action responses - e.g. like/dislike/attend/agree/whatever
242 $response_verbs = ['like', 'dislike', 'announce'];
246 if ($item['object-type'] === ACTIVITY_OBJ_EVENT) {
247 $response_verbs[] = 'attendyes';
248 $response_verbs[] = 'attendno';
249 $response_verbs[] = 'attendmaybe';
250 if ($conv->isWritable()) {
252 $attend = [L10n::t('I will attend'), L10n::t('I will not attend'), L10n::t('I might attend')];
256 $responses = get_responses($conv_responses, $response_verbs, $item, $this);
258 foreach ($response_verbs as $value => $verbs) {
259 $responses[$verbs]['output'] = !empty($conv_responses[$verbs][$item['uri']]) ? format_like($conv_responses[$verbs][$item['uri']], $conv_responses[$verbs][$item['uri'] . '-l'], $verbs, $item['uri']) : '';
263 * We should avoid doing this all the time, but it depends on the conversation mode
264 * And the conv mode may change when we change the conv, or it changes its mode
265 * Maybe we should establish a way to be notified about conversation changes
267 $this->checkWallToWall();
269 if ($this->isWallToWall() && ($this->getOwnerUrl() == $this->getRedirectUrl())) {
270 $osparkle = ' sparkle';
275 if ($this->isToplevel()) {
277 $thread = Item::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
278 if (DBA::isResult($thread)) {
280 'do' => L10n::t("ignore thread"),
281 'undo' => L10n::t("unignore thread"),
282 'toggle' => L10n::t("toggle ignore status"),
283 'classdo' => $thread['ignored'] ? "hidden" : "",
284 'classundo' => $thread['ignored'] ? "" : "hidden",
285 'ignored' => L10n::t('ignored'),
289 if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
290 $isstarred = (($item['starred']) ? "starred" : "unstarred");
293 'do' => L10n::t("add star"),
294 'undo' => L10n::t("remove star"),
295 'toggle' => L10n::t("toggle star status"),
296 'classdo' => $item['starred'] ? "hidden" : "",
297 'classundo' => $item['starred'] ? "" : "hidden",
298 'starred' => L10n::t('starred'),
302 'add' => L10n::t("add tag"),
311 if ($conv->isWritable()) {
313 'like' => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
314 'dislike' => [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")],
317 $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
321 $comment = $this->getCommentBox($indent);
323 if (strcmp(DateTimeFormat::utc($item['created']), DateTimeFormat::utc('now - 12 hours')) > 0) {
327 localize_item($item);
329 $body = Item::prepareBody($item, true);
331 list($categories, $folders) = get_cats_and_terms($item);
334 $text_e = strip_tags($body);
335 $name_e = $profile_name;
337 if (!empty($item['content-warning']) && PConfig::get(local_user(), 'system', 'disable_cw', false)) {
338 $title_e = ucfirst($item['content-warning']);
340 $title_e = $item['title'];
343 $location_e = $location;
344 $owner_name_e = $this->getOwnerName();
346 // Disable features that aren't available in several networks
347 if (!in_array($item["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA]) && isset($buttons["dislike"])) {
348 unset($buttons["dislike"]);
353 if (($item["network"] == Protocol::FEED) && isset($buttons["like"])) {
354 unset($buttons["like"]);
357 if (($item["network"] == Protocol::MAIL) && isset($buttons["like"])) {
358 unset($buttons["like"]);
361 $tags = Term::populateTagsFromItem($item);
364 'template' => $this->getTemplate(),
365 'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
366 'suppress_tags' => Config::get('system', 'suppress_tags'),
367 'tags' => $tags['tags'],
368 'hashtags' => $tags['hashtags'],
369 'mentions' => $tags['mentions'],
370 'implicit_mentions' => $tags['implicit_mentions'],
371 'txt_cats' => L10n::t('Categories:'),
372 'txt_folders' => L10n::t('Filed under:'),
373 'has_cats' => ((count($categories)) ? 'true' : ''),
374 'has_folders' => ((count($folders)) ? 'true' : ''),
375 'categories' => $categories,
376 'folders' => $folders,
379 'id' => $this->getId(),
380 'guid' => urlencode($item['guid']),
381 'isevent' => $isevent,
383 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, $item['author-link']),
384 'olinktitle' => L10n::t('View %s\'s profile @ %s', $this->getOwnerName(), $item['owner-link']),
385 'to' => L10n::t('to'),
386 'via' => L10n::t('via'),
387 'wall' => L10n::t('Wall-to-Wall'),
388 'vwall' => L10n::t('via Wall-To-Wall:'),
389 'profile_url' => $profile_link,
390 'item_photo_menu' => item_photo_menu($item),
392 'thumb' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
393 'osparkle' => $osparkle,
394 'sparkle' => $sparkle,
396 'localtime' => DateTimeFormat::local($item['created'], 'r'),
397 'ago' => $item['app'] ? L10n::t('%s from %s', Temporal::getRelativeDate($item['created']), $item['app']) : Temporal::getRelativeDate($item['created']),
398 'app' => $item['app'],
399 'created' => Temporal::getRelativeDate($item['created']),
401 'location' => $location_e,
404 'owner_self' => $item['author-link'] == Session::get('my_url'),
405 'owner_url' => $this->getOwnerUrl(),
406 'owner_photo' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
407 'owner_name' => $owner_name_e,
408 'plink' => Item::getPlink($item),
410 'isstarred' => $isstarred,
417 'like' => $responses['like']['output'],
418 'dislike' => $responses['dislike']['output'],
419 'responses' => $responses,
420 'switchcomment' => L10n::t('Comment'),
421 'reply_label' => L10n::t('Reply to %s', $name_e),
422 'comment' => $comment,
423 'previewing' => $conv->isPreview() ? ' preview ' : '',
424 'wait' => L10n::t('Please wait'),
425 'thread_level' => $thread_level,
427 'network' => $item["network"],
428 'network_name' => ContactSelector::networkToName($item['network'], $item['author-link']),
429 'received' => $item['received'],
430 'commented' => $item['commented'],
431 'created_date' => $item['created'],
432 'return' => ($a->cmd) ? bin2hex($a->cmd) : '',
434 'queue_count' => $item['delivery_queue_count'],
435 'queue_done' => $item['delivery_queue_done'],
436 'notifier_pending' => L10n::t('Notifier task is pending'),
437 'delivery_pending' => L10n::t('Delivery to remote servers is pending'),
438 'delivery_underway' => L10n::t('Delivery to remote servers is underway'),
439 'delivery_almost' => L10n::t('Delivery to remote servers is mostly done'),
440 'delivery_done' => L10n::t('Delivery to remote servers is done'),
444 $arr = ['item' => $item, 'output' => $tmp_item];
445 Hook::callAll('display_item', $arr);
447 $result = $arr['output'];
449 $result['children'] = [];
450 $children = $this->getChildren();
451 $nb_children = count($children);
452 if ($nb_children > 0) {
453 foreach ($children as $child) {
454 $result['children'][] = $child->getTemplateData($conv_responses, $thread_level + 1);
458 if (($nb_children > 2) || ($thread_level > 1)) {
459 $result['children'][0]['comment_firstcollapsed'] = true;
460 $result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children);
461 $result['children'][0]['show_text'] = L10n::t('Show more');
462 $result['children'][0]['hide_text'] = L10n::t('Show fewer');
463 if ($thread_level > 1) {
464 $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
466 $result['children'][$nb_children - 3]['comment_lastcollapsed'] = true;
471 if ($this->isToplevel()) {
472 $result['total_comments_num'] = "$total_children";
473 $result['total_comments_text'] = L10n::tt('comment', 'comments', $total_children);
476 $result['private'] = $item['private'];
477 $result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : '');
479 if ($this->isThreaded()) {
480 $result['flatten'] = false;
481 $result['threaded'] = true;
483 $result['flatten'] = true;
484 $result['threaded'] = false;
493 public function getId()
495 return $this->getDataValue('id');
501 public function isThreaded()
503 return $this->threaded;
509 * @param Post $item The child item to add
514 public function addChild(Post $item)
516 $item_id = $item->getId();
518 Logger::log('[ERROR] Post::addChild : Item has no ID!!', Logger::DEBUG);
520 } elseif ($this->getChild($item->getId())) {
521 Logger::log('[WARN] Post::addChild : Item already exists (' . $item->getId() . ').', Logger::DEBUG);
525 * Only add what will be displayed
527 if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) {
529 } elseif (activity_match($item->getDataValue('verb'), ACTIVITY_LIKE) || activity_match($item->getDataValue('verb'), ACTIVITY_DISLIKE)) {
533 $item->setParent($this);
534 $this->children[] = $item;
536 return end($this->children);
540 * Get a child by its ID
542 * @param integer $id The child id
546 public function getChild($id)
548 foreach ($this->getChildren() as $child) {
549 if ($child->getId() == $id) {
558 * Get all our children
562 public function getChildren()
564 return $this->children;
570 * @param Post $item The item to set as parent
574 protected function setParent(Post $item)
576 $parent = $this->getParent();
578 $parent->removeChild($this);
581 $this->parent = $item;
582 $this->setThread($item->getThread());
590 protected function removeParent()
592 $this->parent = null;
593 $this->thread = null;
599 * @param Post $item The child to be removed
601 * @return boolean Success or failure
604 public function removeChild(Post $item)
606 $id = $item->getId();
607 foreach ($this->getChildren() as $key => $child) {
608 if ($child->getId() == $id) {
609 $child->removeParent();
610 unset($this->children[$key]);
611 // Reindex the array, in order to make sure there won't be any trouble on loops using count()
612 $this->children = array_values($this->children);
616 Logger::log('[WARN] Item::removeChild : Item is not a child (' . $id . ').', Logger::DEBUG);
625 protected function getParent()
627 return $this->parent;
631 * Set conversation thread
633 * @param Thread $thread
637 public function setThread(Thread $thread = null)
639 $this->thread = $thread;
641 // Set it on our children too
642 foreach ($this->getChildren() as $child) {
643 $child->setThread($thread);
652 public function getThread()
654 return $this->thread;
660 * We shouldn't need this
664 public function getData()
672 * @param string $name key
674 * @return mixed value on success
677 public function getDataValue($name)
679 if (!isset($this->data[$name])) {
680 // Logger::log('[ERROR] Item::getDataValue : Item has no value name "'. $name .'".', Logger::DEBUG);
684 return $this->data[$name];
690 * @param string $name template name
694 private function setTemplate($name)
696 if (empty($this->available_templates[$name])) {
697 Logger::log('[ERROR] Item::setTemplate : Template not available ("' . $name . '").', Logger::DEBUG);
701 $this->template = $this->available_templates[$name];
711 private function getTemplate()
713 return $this->template;
717 * Check if this is a toplevel post
721 private function isToplevel()
723 return $this->toplevel;
727 * Check if this is writable
731 private function isWritable()
733 $conv = $this->getThread();
736 // This will allow us to comment on wall-to-wall items owned by our friends
737 // and community forums even if somebody else wrote the post.
738 // bug #517 - this fixes for conversation owner
739 if ($conv->getMode() == 'profile' && $conv->getProfileOwner() == local_user()) {
743 // this fixes for visitors
744 return ($this->writable || ($this->isVisiting() && $conv->getMode() == 'profile'));
746 return $this->writable;
750 * Count the total of our descendants
754 private function countDescendants()
756 $children = $this->getChildren();
757 $total = count($children);
759 foreach ($children as $child) {
760 $total += $child->countDescendants();
768 * Get the template for the comment box
772 private function getCommentBoxTemplate()
774 return $this->comment_box_template;
778 * Get default text for the comment box
781 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
783 private function getDefaultText()
791 $owner = User::getOwnerDataById($a->user['uid']);
793 if (!Feature::isEnabled(local_user(), 'explicit_mentions')) {
797 $item = Item::selectFirst(['author-addr'], ['id' => $this->getId()]);
798 if (!DBA::isResult($item) || empty($item['author-addr'])) {
803 if ($item['author-addr'] != $owner['addr']) {
804 $text = '@' . $item['author-addr'] . ' ';
809 $terms = Term::tagArrayFromItemId($this->getId(), [Term::MENTION, Term::IMPLICIT_MENTION]);
810 foreach ($terms as $term) {
811 $profile = Contact::getDetailsByURL($term['url']);
812 if (!empty($profile['addr']) && (defaults($profile, 'contact-type', Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
813 ($profile['addr'] != $owner['addr']) && !strstr($text, $profile['addr'])) {
814 $text .= '@' . $profile['addr'] . ' ';
822 * Get the comment box
824 * @param string $indent Indent value
826 * @return mixed The comment box string (empty if no comment box)
830 private function getCommentBox($indent)
835 $conv = $this->getThread();
837 if (($conv->getMode() === 'network') && $this->isWallToWall()) {
841 if ($conv->isWritable() && $this->isWritable()) {
845 * Hmmm, code depending on the presence of a particular addon?
846 * This should be better if done by a hook
848 if (Addon::isEnabled('qcomment')) {
849 $qc = ((local_user()) ? PConfig::get(local_user(), 'qcomment', 'words') : null);
850 $qcomment = (($qc) ? explode("\n", $qc) : null);
853 // Fetch the user id from the parent when the owner user is empty
854 $uid = $conv->getProfileOwner();
855 $parent_uid = $this->getDataValue('uid');
857 $default_text = $this->getDefaultText();
859 if (!is_null($parent_uid) && ($uid != $parent_uid)) {
863 $template = Renderer::getMarkupTemplate($this->getCommentBoxTemplate());
864 $comment_box = Renderer::replaceMacros($template, [
865 '$return_path' => $a->query_string,
866 '$threaded' => $this->isThreaded(),
868 '$wall' => ($conv->getMode() === 'profile'),
869 '$id' => $this->getId(),
870 '$parent' => $this->getId(),
871 '$qcomment' => $qcomment,
872 '$default' => $default_text,
873 '$profile_uid' => $uid,
874 '$mylink' => $a->removeBaseURL($a->contact['url']),
875 '$mytitle' => L10n::t('This is you'),
876 '$myphoto' => $a->removeBaseURL($a->contact['thumb']),
877 '$comment' => L10n::t('Comment'),
878 '$submit' => L10n::t('Submit'),
879 '$edbold' => L10n::t('Bold'),
880 '$editalic' => L10n::t('Italic'),
881 '$eduline' => L10n::t('Underline'),
882 '$edquote' => L10n::t('Quote'),
883 '$edcode' => L10n::t('Code'),
884 '$edimg' => L10n::t('Image'),
885 '$edurl' => L10n::t('Link'),
886 '$edattach' => L10n::t('Link or Media'),
887 '$prompttext' => L10n::t('Please enter a image/video/audio/webpage URL:'),
888 '$preview' => L10n::t('Preview'),
889 '$indent' => $indent,
890 '$sourceapp' => L10n::t($a->sourcename),
891 '$ww' => $conv->getMode() === 'network' ? $ww : '',
892 '$rand_num' => Crypto::randomDigits(12)
902 private function getRedirectUrl()
904 return $this->redirect_url;
908 * Check if we are a wall to wall item and set the relevant properties
913 protected function checkWallToWall()
916 $conv = $this->getThread();
917 $this->wall_to_wall = false;
919 if ($this->isToplevel()) {
920 if ($conv->getMode() !== 'profile') {
921 if ($this->getDataValue('wall') && !$this->getDataValue('self')) {
922 // On the network page, I am the owner. On the display page it will be the profile owner.
923 // This will have been stored in $a->page_contact by our calling page.
924 // Put this person as the wall owner of the wall-to-wall notice.
926 $this->owner_url = Contact::magicLink($a->page_contact['url']);
927 $this->owner_photo = $a->page_contact['thumb'];
928 $this->owner_name = $a->page_contact['name'];
929 $this->wall_to_wall = true;
930 } elseif ($this->getDataValue('owner-link')) {
931 $owner_linkmatch = (($this->getDataValue('owner-link')) && Strings::compareLink($this->getDataValue('owner-link'), $this->getDataValue('author-link')));
932 $alias_linkmatch = (($this->getDataValue('alias')) && Strings::compareLink($this->getDataValue('alias'), $this->getDataValue('author-link')));
933 $owner_namematch = (($this->getDataValue('owner-name')) && $this->getDataValue('owner-name') == $this->getDataValue('author-name'));
935 if (!$owner_linkmatch && !$alias_linkmatch && !$owner_namematch) {
936 // The author url doesn't match the owner (typically the contact)
937 // and also doesn't match the contact alias.
938 // The name match is a hack to catch several weird cases where URLs are
939 // all over the park. It can be tricked, but this prevents you from
940 // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
941 // well that it's the same Bob Smith.
942 // But it could be somebody else with the same name. It just isn't highly likely.
945 $this->owner_photo = $this->getDataValue('owner-avatar');
946 $this->owner_name = $this->getDataValue('owner-name');
947 $this->wall_to_wall = true;
949 $owner = ['uid' => 0, 'id' => $this->getDataValue('owner-id'),
950 'network' => $this->getDataValue('owner-network'),
951 'url' => $this->getDataValue('owner-link')];
952 $this->owner_url = Contact::magicLinkByContact($owner);
958 if (!$this->wall_to_wall) {
959 $this->setTemplate('wall');
960 $this->owner_url = '';
961 $this->owner_photo = '';
962 $this->owner_name = '';
969 private function isWallToWall()
971 return $this->wall_to_wall;
977 private function getOwnerUrl()
979 return $this->owner_url;
985 private function getOwnerName()
987 return $this->owner_name;
993 private function isVisiting()
995 return $this->visiting;