aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php56
1 files changed, 33 insertions, 23 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 0bb9c769a..61ca208b2 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -404,7 +404,7 @@ function count_descendants($item) {
* @return boolean
*/
function visible_activity($item) {
- $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ];
+ $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_POLLRESPONSE ];
if(intval($item['item_notshown']))
return false;
@@ -838,11 +838,11 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$item_object = new Zotlabs\Lib\ThreadItem($item);
$conv->add_thread($item_object);
- if($page_mode === 'list') {
+ if(($page_mode === 'list') || ($page_mode === 'pager_list')) {
$item_object->set_template('conv_list.tpl');
$item_object->set_display_mode('list');
}
- if($page_mode === 'cards') {
+ if($mode === 'cards' || $mode === 'articles') {
$item_object->set_reload($jsreload);
}
@@ -857,7 +857,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
}
}
- if($page_mode === 'traditional' || $page_mode === 'preview') {
+ if(in_array($page_mode, [ 'traditional', 'preview', 'pager_list'] )) {
$page_template = get_markup_template("threaded_conversation.tpl");
}
elseif($update) {
@@ -930,7 +930,7 @@ function thread_action_menu($item,$mode = '') {
$menu[] = [
'menu' => 'view_source',
'title' => t('View Source'),
- 'icon' => 'eye',
+ 'icon' => 'code',
'action' => 'viewsrc(' . $item['id'] . '); return false;',
'href' => '#'
];
@@ -1001,18 +1001,21 @@ function thread_author_menu($item, $mode = '') {
$profile_link = chanlink_hash($item['author_xchan']);
$contact = false;
- if(App::$contacts && array_key_exists($item['author_xchan'],App::$contacts))
- $contact = App::$contacts[$item['author_xchan']];
- else
- if($local_channel && $item['author']['xchan_addr'])
- $follow_url = z_root() . '/follow/?f=&url=' . urlencode($item['author']['xchan_addr']);
-
+ if($channel['channel_hash'] !== $item['author_xchan']) {
+ if(App::$contacts && array_key_exists($item['author_xchan'],App::$contacts)) {
+ $contact = App::$contacts[$item['author_xchan']];
+ }
+ else {
+ if($local_channel && $item['author']['xchan_addr'] && (! in_array($item['author']['xchan_network'],[ 'rss', 'anon','unknown' ]))) {
+ $follow_url = z_root() . '/follow/?f=&url=' . urlencode($item['author']['xchan_addr']) . '&interactive=0';
+ }
+ }
- if($item['uid'] > 0 && author_is_pmable($item['author'],$contact)) {
- $pm_url = z_root() . '/mail/new/?f=&hash=' . urlencode($item['author_xchan']);
+ if($item['uid'] > 0 && author_is_pmable($item['author'],$contact)) {
+ $pm_url = z_root() . '/mail/new/?f=&hash=' . urlencode($item['author_xchan']);
+ }
}
-
if($contact) {
$poke_link = z_root() . '/poke/?f=&c=' . $contact['abook_id'];
if (! intval($contact['abook_self']))
@@ -1039,7 +1042,7 @@ function thread_author_menu($item, $mode = '') {
if($posts_link) {
$menu[] = [
'menu' => 'view_posts',
- 'title' => t('Activity/Posts'),
+ 'title' => t('Recent Activity'),
'icon' => 'fw',
'action' => '',
'href' => $posts_link
@@ -1051,8 +1054,8 @@ function thread_author_menu($item, $mode = '') {
'menu' => 'follow',
'title' => t('Connect'),
'icon' => 'fw',
- 'action' => '',
- 'href' => $follow_url
+ 'action' => 'doFollowAuthor(\'' . $follow_url . '\'); return false;',
+ 'href' => '#',
];
}
@@ -1159,7 +1162,7 @@ function builtin_activity_puller($item, &$conv_responses) {
if((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) {
$name = (($item['author']['xchan_name']) ? $item['author']['xchan_name'] : t('Unknown'));
$url = (($item['author_xchan'] && $item['author']['xchan_photo_s'])
- ? '<a class="dropdown-item" href="' . chanlink_hash($item['author_xchan']) . '">' . '<img class="menu-img-1" src="' . zid($item['author']['xchan_photo_s']) . '" alt="' . urlencode($name) . '" />' . $name . '</a>'
+ ? '<a class="dropdown-item" href="' . chanlink_hash($item['author_xchan']) . '">' . '<img class="menu-img-1" src="' . zid($item['author']['xchan_photo_s']) . '" alt="' . urlencode($name) . '" /> ' . $name . '</a>'
: '<a class="dropdown-item" href="#" class="disabled">' . $name . '</a>'
);
@@ -1279,7 +1282,7 @@ function status_editor($a, $x, $popup = false) {
if(x($x, 'hide_weblink'))
$weblink = false;
- $embedPhotos = t('Embed image from photo albums');
+ $embedPhotos = t('Embed (existing) photo from your photo albums');
$writefiles = (($mimetype === 'text/bbcode') ? perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage') : false);
if(x($x, 'hide_attach'))
@@ -1302,6 +1305,10 @@ function status_editor($a, $x, $popup = false) {
$webpage = ((x($x,'webpage')) ? $x['webpage'] : '');
+ $reset = ((x($x,'reset')) ? $x['reset'] : '');
+
+ $feature_auto_save_draft = ((feature_enabled($x['profile_uid'], 'auto_save_draft')) ? "true" : "false");
+
$tpl = get_markup_template('jot-header.tpl');
App::$page['htmlhead'] .= replace_macros($tpl, array(
@@ -1323,6 +1330,8 @@ function status_editor($a, $x, $popup = false) {
'$modalerroralbum' => t('Error getting album'),
'$nocomment_enabled' => t('Comments enabled'),
'$nocomment_disabled' => t('Comments disabled'),
+ '$auto_save_draft' => $feature_auto_save_draft,
+ '$reset' => $reset
));
$tpl = get_markup_template('jot.tpl');
@@ -1379,7 +1388,7 @@ function status_editor($a, $x, $popup = false) {
'$underline' => t('Underline'),
'$quote' => t('Quote'),
'$code' => t('Code'),
- '$attach' => t('Attach file'),
+ '$attach' => t('Attach/Upload file'),
'$weblink' => $weblink,
'$embedPhotos' => $embedPhotos,
'$embedPhotosModalTitle' => t('Embed an image from your albums'),
@@ -1435,7 +1444,8 @@ function status_editor($a, $x, $popup = false) {
'$expiryModalCANCEL' => t('Cancel'),
'$expanded' => ((x($x, 'expanded')) ? $x['expanded'] : false),
'$bbcode' => ((x($x, 'bbcode')) ? $x['bbcode'] : false),
- '$parent' => ((array_key_exists('parent',$x) && $x['parent']) ? $x['parent'] : 0)
+ '$parent' => ((array_key_exists('parent',$x) && $x['parent']) ? $x['parent'] : 0),
+ '$reset' => $reset
));
if ($popup === true) {
@@ -1607,7 +1617,7 @@ function prepare_page($item) {
// prepare_body calls unobscure() as a side effect. Do it here so that
// the template will get passed an unobscured title.
- $body = prepare_body($item, true);
+ $body = prepare_body($item, [ 'newwin' => false ]);
if(App::$page['template'] == 'none') {
$tpl = 'page_display_empty.tpl';
@@ -1721,7 +1731,7 @@ function network_tabs() {
if(feature_enabled(local_channel(),'star_posts')) {
$tabs[] = array(
'label' => t('Starred'),
- 'url'=>z_root() . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
+ 'url'=>z_root() . '/' . $cmd . '/?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&star=1',
'sel'=>$starred_active,
'title' => t('Favourite Posts'),
);