diff options
Diffstat (limited to 'include/conversation.php')
-rw-r--r-- | include/conversation.php | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/include/conversation.php b/include/conversation.php index 8bbb87e2c..a5fe573cd 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -96,7 +96,7 @@ function localize_item(&$item){ if(! $item['object']) return; - if($item['item_flags'] & ITEM_THREAD_TOP) + if(intval($item['item_thread_top'])) return; $obj = json_decode_plus($item['object']); @@ -356,21 +356,12 @@ function localize_item(&$item){ } } */ - // add sparkle links to appropriate permalinks - -// $x = stristr($item['plink'],'/display/'); -// if($x) { -// $sparkle = false; -// $y = best_link_url($item,$sparkle,true); - // if($sparkle) -// $item['plink'] = $y . '?f=&url=' . $item['plink']; -// } // if item body was obscured and we changed it, re-obscure it // FIXME - we need a better filter than just the string 'data'; try and // match the fact that it's json encoded - if(($item['item_flags'] & ITEM_OBSCURED) + if(intval($item['item_obscured']) && strlen($item['body']) && (! strpos($item['body'],'data'))) { $item['body'] = json_encode(crypto_encapsulate($item['body'],get_config('system','pubkey'))); } @@ -638,11 +629,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ if($item['author-link'] && (! $item['author-name'])) $profile_name = $item['author-link']; - - $tags=array(); - $hashtags = array(); - $mentions = array(); - $sp = false; $profile_link = best_link_url($item,$sp); if($sp) @@ -682,19 +668,21 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $likebuttons = false; $shareable = false; - $verified = (($item['item_flags'] & ITEM_VERIFIED) ? t('Message signature validated') : ''); - $forged = ((($item['sig']) && (! ($item['item_flags'] & ITEM_VERIFIED))) ? t('Message signature incorrect') : ''); + $verified = (intval($item['item_verified']) ? t('Message signature validated') : ''); + $forged = ((($item['sig']) && (! intval($item['item_verified']))) ? t('Message signature incorrect') : ''); $unverified = ''; - $tags=array(); - $terms = get_terms_oftype($item['term'],array(TERM_HASHTAG,TERM_MENTION,TERM_UNKNOWN)); - if(count($terms)) - foreach($terms as $tag) - $tags[] = format_term_for_display($tag); +// $tags=array(); +// $terms = get_terms_oftype($item['term'],array(TERM_HASHTAG,TERM_MENTION,TERM_UNKNOWN)); +// if(count($terms)) +// foreach($terms as $tag) +// $tags[] = format_term_for_display($tag); $body = prepare_body($item,true); + $has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false); + $tmp_item = array( 'template' => $tpl, 'toplevel' => 'toplevel_item', @@ -708,10 +696,13 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'lock' => $lock, 'thumb' => $profile_avatar, 'title' => $item['title'], - 'body' => $body, - 'tags' => $tags, - 'hashtags' => $hashtags, - 'mentions' => $mentions, + 'body' => $body['html'], + 'photo' => $body['photo'], + 'tags' => $body['tags'], + 'categories' => $body['categories'], + 'mentions' => $body['mentions'], + 'attachments' => $body['attachments'], + 'folders' => $body['folders'], 'verified' => $verified, 'unverified' => $unverified, 'forged' => $forged, @@ -721,7 +712,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'has_folders' => ((count($folders)) ? 'true' : ''), 'categories' => $categories, 'folders' => $folders, - 'text' => strip_tags($body), + 'text' => strip_tags($body['html']), 'ago' => relative_date($item['created']), 'app' => $item['app'], 'str_app' => sprintf( t('from %s'), $item['app']), @@ -747,6 +738,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'previewing' => $previewing, 'wait' => t('Please wait'), 'thread_level' => 1, + 'has_tags' => $has_tags, ); $arr = array('item' => $item, 'output' => $tmp_item); @@ -925,6 +917,9 @@ function item_photo_menu($item){ if($item['parent'] == $item['id'] && $channel && ($channel_hash != $item['author_xchan'])) { $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;'; } + if($channel) { + $unsub_link = 'javascript:dounsubthread(' . $item['id'] . '); return false;'; + } } $profile_link = chanlink_hash($item['author_xchan']); @@ -939,7 +934,7 @@ function item_photo_menu($item){ if($contact) { $poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $contact['abook_id']; - if (!($contact['abook_flags'] & ABOOK_FLAG_SELF)) + if (! intval($contact['abook_self'])) $contact_url = $a->get_baseurl($ssl_state) . '/connedit/' . $contact['abook_id']; $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $contact['abook_id']; @@ -949,12 +944,13 @@ function item_photo_menu($item){ $menu = Array( t("View Source") => $vsrc_link, t("Follow Thread") => $sub_link, + t("Stop Following") => $unsub_link, t("View Status") => $status_link, t("View Profile") => $profile_link, t("View Photos") => $photos_link, - t("Matrix Activity") => $posts_link, + t("Activity/Posts") => $posts_link, t("Connect") => $follow_url, - t("Edit Contact") => $contact_url, + t("Edit Connection") => $contact_url, t("Send PM") => $pm_url, t("Poke") => $poke_link ); @@ -1146,6 +1142,7 @@ function status_editor($a, $x, $popup = false) { '$newpost' => 'true', '$baseurl' => $a->get_baseurl(true), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), + '$pretext' => ((x($x,'pretext')) ? $x['pretext'] : ''), '$geotag' => $geotag, '$nickname' => $x['nickname'], '$ispublic' => t('Visible to <strong>everybody</strong>'), @@ -1172,6 +1169,10 @@ function status_editor($a, $x, $popup = false) { if($defexpire) $defexpire = datetime_convert('UTC',date_default_timezone_get(),$defexpire,'Y-m-d H:i'); + $defpublish = ((($z = get_pconfig($x['profile_uid'], 'system', 'default_post_publish')) && (! $webpage)) ? $z : ''); + if($defpublish) + $defpublish = datetime_convert('UTC',date_default_timezone_get(),$defpublish,'Y-m-d H:i'); + $cipher = get_pconfig($x['profile_uid'], 'system', 'default_cipher'); if(! $cipher) $cipher = 'aes256'; @@ -1188,7 +1189,7 @@ function status_editor($a, $x, $popup = false) { '$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''), '$id_select' => $id_select, '$id_seltext' => t('Post as'), - '$writefiles' => (perm_is_allowed($x['profile_uid'], get_observer_hash(), 'post_photos') || perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage')), + '$writefiles' => perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage'), '$bold' => t('Bold'), '$italic' => t('Italic'), '$underline' => t('Underline'), @@ -1243,6 +1244,9 @@ function status_editor($a, $x, $popup = false) { '$defexpire' => $defexpire, '$feature_expire' => ((feature_enabled($x['profile_uid'], 'content_expire') && (! $webpage)) ? true : false), '$expires' => t('Set expiration date'), + '$defpublish' => $defpublish, + '$feature_future' => ((feature_enabled($x['profile_uid'], 'delayed_posting') && (! $webpage)) ? true : false), + '$future_txt' => t('Set publish date'), '$feature_encrypt' => ((feature_enabled($x['profile_uid'], 'content_encrypt') && (! $webpage)) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, @@ -1397,7 +1401,8 @@ function render_location_default($item) { function prepare_page($item) { $a = get_app(); - $naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0); + $naked = 1; +// $naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0); $observer = $a->get_observer(); //240 chars is the longest we can have before we start hitting problems with suhosin sites $preview = substr(urlencode($item['body']), 0, 240); @@ -1421,7 +1426,7 @@ function prepare_page($item) { '$auth_url' => (($naked) ? '' : zid($item['author']['xchan_url'])), '$date' => (($naked) ? '' : datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'Y-m-d H:i')), '$title' => smilies(bbcode($item['title'])), - '$body' => $body, + '$body' => $body['html'], '$preview' => $preview, '$link' => $link, )); @@ -1606,7 +1611,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ 'id' => 'profile-tab', ); } - if ($p['view_photos']) { + if ($p['view_storage']) { $tabs[] = array( 'label' => t('Photos'), 'url' => $a->get_baseurl() . '/photos/' . $nickname, @@ -1614,11 +1619,9 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ 'title' => t('Photo Albums'), 'id' => 'photo-tab', ); - } - if ($p['view_storage']) { $tabs[] = array( 'label' => t('Files'), - 'url' => $a->get_baseurl() . '/cloud/' . $nickname . ((get_observer_hash()) ? '' : '?f=&davguest=1'), + 'url' => $a->get_baseurl() . '/cloud/' . $nickname, 'sel' => ((argv(0) == 'cloud' || argv(0) == 'sharedwithme') ? 'active' : ''), 'title' => t('Files and Storage'), 'id' => 'files-tab', |