aboutsummaryrefslogtreecommitdiffstats
path: root/include/ConversationObject.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2013-10-25 00:09:42 -0700
committerPaolo T <tuscanhobbit@users.noreply.github.com>2013-10-25 00:09:42 -0700
commitb23f3fc03b6bc751aab67fe2258a21f7c65bab8e (patch)
tree84c997aa781afa566536ca5f66eb8f90ef468476 /include/ConversationObject.php
parentd30f718e0836a031e43d5403480aa049561e736e (diff)
parent0b0bd3c20765d267ec6d7cc261c7713917a22582 (diff)
downloadvolse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.tar.gz
volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.tar.bz2
volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.zip
Merge pull request #3 from friendica/master
Align to main project HEAD
Diffstat (limited to 'include/ConversationObject.php')
-rw-r--r--include/ConversationObject.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php
index bb144d893..d8c6bca77 100644
--- a/include/ConversationObject.php
+++ b/include/ConversationObject.php
@@ -22,10 +22,17 @@ class Conversation extends BaseObject {
private $commentable = false;
private $profile_owner = 0;
private $preview = false;
+ private $prepared_item = '';
- public function __construct($mode, $preview) {
+
+ // $prepared_item is for use by alternate conversation structures such as photos
+ // wherein we've already prepared a top level item which doesn't look anything like
+ // a normal "post" item
+
+ public function __construct($mode, $preview, $prepared_item = '') {
$this->set_mode($mode);
$this->preview = $preview;
+ $this->prepared_item = $prepared_item;
}
/**
@@ -180,7 +187,12 @@ class Conversation extends BaseObject {
foreach($this->threads as $item) {
- $item_data = $item->get_template_data($alike, $dlike);
+ if(($item->get_data_value('id') == $item->get_data_value('parent')) && $this->prepared_item) {
+ $item_data = $this->prepared_item;
+ }
+ else {
+ $item_data = $item->get_template_data($alike, $dlike);
+ }
if(!$item_data) {
logger('[ERROR] Conversation::get_template_data : Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG);
return false;