diff options
author | Olivier van Helden <olivier@van-helden.net> | 2014-12-03 17:54:07 -0400 |
---|---|---|
committer | Olivier van Helden <olivier@van-helden.net> | 2014-12-03 17:54:07 -0400 |
commit | e523061b7261439a71bdacf8f46d4c614740b356 (patch) | |
tree | 1a0577c64197c4289ed154d2c2d5fdf48a7e5192 /include/conversation.php | |
parent | 13fd91d6f5723774a1b96257f8096acb2873b4ed (diff) | |
parent | b71b45aafc618d32d23c099a4d4db8bad2f09e54 (diff) | |
download | volse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.tar.gz volse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.tar.bz2 volse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.zip |
Merge pull request #1 from friendica/master
Merge master from friendica
Diffstat (limited to 'include/conversation.php')
-rw-r--r-- | include/conversation.php | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/include/conversation.php b/include/conversation.php index a531de9ba..6b3e278f0 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -419,8 +419,6 @@ function visible_activity($item) { function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $prepared_item = '') { - $tstart = dba_timer(); - $t0 = $t1 = $t2 = $t3 = $t4 = $t5 = $t6 = null; $content_html = ''; $o = ''; @@ -452,8 +450,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ if($mode === 'network') { - $t1 = dba_timer(); - $profile_owner = local_user(); $page_writeable = true; @@ -790,29 +786,21 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $item['pagedrop'] = $page_dropping; if($item['id'] == $item['parent']) { -// $tx1 = dba_timer(); + $item_object = new Item($item); $conv->add_thread($item_object); - if($page_mode === 'list') + if($page_mode === 'list') { $item_object->set_template('conv_list.tpl'); - -// $tx2 = dba_timer(); -// if($mode === 'network') -// profiler($tx1,$tx2,'add thread ' . $item['id']); + $item_object->set_display_mode('list'); + } } } - $t2 = dba_timer(); + $threads = $conv->get_template_data($alike, $dlike); if(!$threads) { logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); $threads = array(); } - $t3 = dba_timer(); - if($mode === 'network') { - profiler($t1,$t2,'Conversation prepare'); - profiler($t2,$t3,'Conversation get_template'); - } - } } @@ -848,14 +836,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ '$dropping' => ($page_dropping?t('Delete Selected Items'):False), )); - if($mode === 'network') { - $t4 = dba_timer(); - profiler($t3,$t4,'conversation template'); - } - - if($page_mode === 'preview') - logger('preview: ' . $o); - return $o; } @@ -905,15 +885,18 @@ function item_photo_menu($item){ $vsrc_link = ""; $follow_url = ""; - if(local_user()) { + + $local_user = local_user(); + + if($local_user) { $ssl_state = true; if(! count($a->contacts)) - load_contact_links(local_user()); + load_contact_links($local_user); $channel = $a->get_channel(); $channel_hash = (($channel) ? $channel['channel_hash'] : ''); } - if((local_user()) && local_user() == $item['uid']) { + if(($local_user) && $local_user == $item['uid']) { $vsrc_link = 'javascript:viewsrc(' . $item['id'] . '); return false;'; if($item['parent'] == $item['id'] && $channel && ($channel_hash != $item['author_xchan'])) { $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;'; @@ -921,17 +904,19 @@ function item_photo_menu($item){ } $profile_link = chanlink_hash($item['author_xchan']); - $pm_url = $a->get_baseurl($ssl_state) . '/mail/new/?f=&hash=' . $item['author_xchan']; + if($item['uid'] > 0) + $pm_url = $a->get_baseurl($ssl_state) . '/mail/new/?f=&hash=' . $item['author_xchan']; if($a->contacts && array_key_exists($item['author_xchan'],$a->contacts)) $contact = $a->contacts[$item['author_xchan']]; else - if(local_user() && $item['author']['xchan_addr']) + if($local_user && $item['author']['xchan_addr']) $follow_url = z_root() . '/follow/?f=&url=' . $item['author']['xchan_addr']; if($contact) { $poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $contact['abook_id']; - $contact_url = $a->get_baseurl($ssl_state) . '/connedit/' . $contact['abook_id']; + if (!($contact['abook_flags'] & ABOOK_FLAG_SELF)) + $contact_url = $a->get_baseurl($ssl_state) . '/connedit/' . $contact['abook_id']; $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $contact['abook_id']; $clean_url = normalise_link($item['author-link']); @@ -1493,8 +1478,12 @@ function network_tabs() { function profile_tabs($a, $is_owner=False, $nickname=Null){ - //echo "<pre>"; var_dump($a->user); killme(); - + + // Don't provide any profile tabs if we're running as the sys channel + + if($a->is_sys) + return; + $channel = $a->get_channel(); if (is_null($nickname)) |