From ab2376f8d85877f95c20fad3a3ece4ef517e083b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 17:42:02 -0800 Subject: fix dreport link --- Zotlabs/Lib/ThreadItem.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 78714c2c4..93d8aa3a5 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -299,8 +299,10 @@ class ThreadItem { if($keep_reports === 0) $keep_reports = 10; - if((! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) + if((! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) { $dreport = t('Delivery Report'); + $dreport_link = gen_link_id($item['mid']); + } if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) $is_new = true; @@ -316,7 +318,7 @@ class ThreadItem { $owner_address = substr($item['owner']['xchan_addr'],0,strpos($item['owner']['xchan_addr'],'@')); $viewthread = $item['llink']; if($conv->get_mode() === 'channel') - $viewthread = z_root() . '/channel/' . $owner_address . '?f=&mid=' . urlencode($item['mid']); + $viewthread = z_root() . '/channel/' . $owner_address . '?f=&mid=' . urlencode(gen_link_id($item['mid'])); $comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children ); $list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : ''); @@ -364,6 +366,7 @@ class ThreadItem { 'thread_action_menu' => thread_action_menu($item,$conv->get_mode()), 'thread_author_menu' => thread_author_menu($item,$conv->get_mode()), 'dreport' => $dreport, + 'dreport_link' => $dreport_link, 'name' => $profile_name, 'thumb' => $profile_avatar, 'osparkle' => $osparkle, -- cgit v1.2.3 From 7aaa1973f492c3505b132a1f6af6c897fa6e0581 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 19 Nov 2018 15:04:08 -0800 Subject: push recent changes --- Zotlabs/Lib/ThreadItem.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 93d8aa3a5..98fb5c268 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -39,6 +39,9 @@ class ThreadItem { $this->data = $data; $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); + $conv = $this->get_conversation(); + $observer = $conv->get_observer(); + // Prepare the children if($data['children']) { foreach($data['children'] as $item) { @@ -51,6 +54,7 @@ class ThreadItem { continue; } + $child = new ThreadItem($item); $this->add_child($child); } -- cgit v1.2.3 From 6481c9dca18d5b0e09e495b30edff987ac2da0b5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 19 Nov 2018 15:20:28 -0800 Subject: use this form instead --- Zotlabs/Lib/ThreadItem.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 98fb5c268..83d243177 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -39,8 +39,7 @@ class ThreadItem { $this->data = $data; $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); - $conv = $this->get_conversation(); - $observer = $conv->get_observer(); + $observer = \App::get_observer(); // Prepare the children if($data['children']) { -- cgit v1.2.3