]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Merge pull request #9196 from annando/queryValue
[friendica.git] / include / conversation.php
index dda15fa65bfe61949a327bf25baad7aa4e6de9c1..a995ea4ad17ee322c022c470556f6300204674b9 100644 (file)
@@ -741,32 +741,39 @@ function conversation_fetch_comments($thread_items, $pinned) {
                        $direction = ['direction' => 5, 'title' => DI::l10n()->t('%s commented on this.', $row['author-name'])];
                }
 
-               if (($row['gravity'] == GRAVITY_PARENT) && !$row['origin'] && ($row['author-id'] == $row['owner-id'])) {
-                       if (Contact::isSharing($row['author-id'], $row['uid'])) {
+               switch ($row['post-type']) {
+                       case Item::PT_TO:
+                               $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'to')];
+                               break;
+                       case Item::PT_CC:
+                               $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'cc')];
+                               break;
+                       case Item::PT_BTO:
+                               $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bto')];
+                               break;
+                       case Item::PT_BCC:
+                               $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bcc')];
+                               break;
+                       case Item::PT_FOLLOWER:
                                $row['direction'] = ['direction' => 6, 'title' => DI::l10n()->t('You are following %s.', $row['author-name'])];
-                       } else {
-                               if ($row['post-type'] == Item::PT_TAG) {
-                                       $row['direction'] = ['direction' => 4, 'title' => DI::l10n()->t('Tagged')];
-                               }
-                               $parentlines[] = $lineno;
-                       }
+                               break;
+                       case Item::PT_TAG:
+                               $row['direction'] = ['direction' => 4, 'title' => DI::l10n()->t('Tagged')];
+                               break;
+                       case Item::PT_ANNOUNCEMENT:
+                               $row['direction'] = ['direction' => 3, 'title' => DI::l10n()->t('Reshared')];
+                               break;
+                       case Item::PT_COMMENT:
+                               $row['direction'] = ['direction' => 5, 'title' => DI::l10n()->t('%s is participating in this thread.', $row['author-name'])];
+                               break;
+                       case Item::PT_STORED:
+                               $row['direction'] = ['direction' => 8, 'title' => DI::l10n()->t('Stored')];
+                               break;
+               }
 
-                       switch ($row['post-type']) {
-                               case Item::PT_TO:
-                                       $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'to')];
-                                       break;
-                               case Item::PT_CC:
-                                       $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'cc')];
-                                       break;
-                               case Item::PT_BTO:
-                                       $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bto')];
-                                       break;
-                               case Item::PT_BCC:
-                                       $row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bcc')];
-                                       break;
-                               case Item::PT_FOLLOWER:
-                                       $row['direction'] = ['direction' => 6, 'title' => DI::l10n()->t('You are following %s.', $row['author-name'])];
-                       }
+               if (($row['gravity'] == GRAVITY_PARENT) && !$row['origin'] && ($row['author-id'] == $row['owner-id']) &&
+                       !Contact::isSharing($row['author-id'], $row['uid'])) {
+                       $parentlines[] = $lineno;
                }
 
                if ($row['gravity'] == GRAVITY_PARENT) {
@@ -1164,17 +1171,12 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
        $jotplugins = '';
        Hook::callAll('jot_tool', $jotplugins);
 
-       $query_str = DI::args()->getQueryString();
-       if (strpos($query_str, 'public=1') !== false) {
-               $query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
-       }
-
        // $tpl = Renderer::replaceMacros($tpl,array('$jotplugins' => $jotplugins));
        $tpl = Renderer::getMarkupTemplate("jot.tpl");
 
        $o .= Renderer::replaceMacros($tpl,[
                '$new_post' => DI::l10n()->t('New Post'),
-               '$return_path'  => $query_str,
+               '$return_path'  => DI::args()->getQueryString(),
                '$action'       => 'item',
                '$share'        => ($x['button'] ?? '') ?: DI::l10n()->t('Share'),
                '$loading'      => DI::l10n()->t('Loading...'),