]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Merge pull request #9444 from annando/update
[friendica.git] / include / conversation.php
index b984c3da2e2a9caaafc635b42d870d4e659826fd..6adc00d0c40d795dad1e2fcfb7d03542dc36b2c2 100644 (file)
@@ -452,8 +452,8 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                $profile_owner = 0;
 
                if (!$update) {
-                       $live_update_div = '<div id="live-contacts"></div>' . "\r\n"
-                               . "<script> var profile_uid = -1; var netargs = '" . substr(DI::args()->getCommand(), 9)
+                       $live_update_div = '<div id="live-contact"></div>' . "\r\n"
+                               . "<script> var profile_uid = -1; var netargs = '" . substr(DI::args()->getCommand(), 8)
                                ."/?f='; </script>\r\n";
                }
        } elseif ($mode === 'search') {
@@ -501,7 +501,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                        $writable = false;
                }
 
-               if (in_array($mode, ['network-new', 'search', 'contact-posts'])) {
+               if (in_array($mode, ['filed', 'search', 'contact-posts'])) {
 
                        /*
                         * "New Item View" on network page or search page results
@@ -548,7 +548,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                                $location_html = $locate['html'] ?: Strings::escapeHtml($locate['location'] ?: $locate['coord'] ?: '');
 
                                localize_item($item);
-                               if ($mode === 'network-new') {
+                               if ($mode === 'filed') {
                                        $dropping = true;
                                } else {
                                        $dropping = false;
@@ -562,9 +562,10 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                                ];
 
                                $likebuttons = [
-                                       'like'    => null,
-                                       'dislike' => null,
-                                       'share'   => null,
+                                       'like'     => null,
+                                       'dislike'  => null,
+                                       'share'    => null,
+                                       'announce' => null,
                                ];
 
                                if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) {
@@ -585,6 +586,10 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                                        'template' => $tpl,
                                        'id' => ($preview ? 'P0' : $item['id']),
                                        'guid' => ($preview ? 'Q0' : $item['guid']),
+                                       'commented' => $item['commented'],
+                                       'received' => $item['received'],
+                                       'created_date' => $item['created'],
+                                       'uriid' => $item['uri-id'],
                                        'network' => $item['network'],
                                        'network_name' => ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network']),
                                        'network_icon' => ContactSelector::networkToIcon($item['network'], $item['author-link']),
@@ -692,6 +697,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                '$live_update' => $live_update_div,
                '$remove' => DI::l10n()->t('remove'),
                '$mode' => $mode,
+               '$update' => $update,
                '$user' => $a->user,
                '$threads' => $threads,
                '$dropping' => ($page_dropping ? DI::l10n()->t('Delete Selected Items') : False),
@@ -734,7 +740,7 @@ function conversation_fetch_comments($thread_items, $pinned) {
                                $row['direction'] = ['direction' => 4, 'title' => DI::l10n()->t('Tagged')];
                                break;
                        case Item::PT_ANNOUNCEMENT:
-                               if (!empty($row['causer-id']) && DI::pConfig()->get(local_user(), 'system', 'display_resharer')  ) {
+                               if (!empty($row['causer-id']) && DI::pConfig()->get(local_user(), 'system', 'display_resharer')) {
                                        $row['owner-link'] = $row['causer-link'];
                                        $row['owner-avatar'] = $row['causer-avatar'];
                                        $row['owner-name'] = $row['causer-name'];
@@ -913,13 +919,17 @@ function item_photo_menu($item) {
                        DI::l10n()->t('Ignore') => $ignore_link
                ];
 
+               if (!empty($item['language'])) {
+                       $menu[DI::l10n()->t('Languages')] = 'javascript:alert(\'' . Item::getLanguageMessage($item) . '\');';
+               }
+
                if ($network == Protocol::DFRN) {
                        $menu[DI::l10n()->t("Poke")] = $poke_link;
                }
 
                if ((($cid == 0) || ($rel == Contact::FOLLOWER)) &&
                        in_array($item['network'], Protocol::FEDERATED)) {
-                       $menu[DI::l10n()->t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']);
+                       $menu[DI::l10n()->t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']) . '&auto=1';
                }
        } else {
                $menu = [DI::l10n()->t('View Profile') => $item['author-link']];