]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Conversation.php
Fix code standards
[friendica.git] / src / Content / Conversation.php
index 7edd4415db416a32199b4b3095ff82773f7f8910..c52517cf8a350c87da7e6ffb92d038310d92aa55 100644 (file)
@@ -57,6 +57,7 @@ use Psr\Log\LoggerInterface;
 
 class Conversation
 {
+       const MODE_CHANNEL       = 'channel';
        const MODE_COMMUNITY     = 'community';
        const MODE_CONTACTS      = 'contacts';
        const MODE_CONTACT_POSTS = 'contact-posts';
@@ -494,7 +495,9 @@ class Conversation
                                        . (!empty($_GET['cmin'])      ? '&cmin='      . rawurlencode($_GET['cmin'])      : '')
                                        . (!empty($_GET['cmax'])      ? '&cmax='      . rawurlencode($_GET['cmax'])      : '')
                                        . (!empty($_GET['file'])      ? '&file='      . rawurlencode($_GET['file'])      : '')
-
+                                       . (!empty($_GET['channel'])   ? '&channel='   . rawurlencode($_GET['channel'])   : '')
+                                       . (!empty($_GET['no_sharer']) ? '&no_sharer=' . rawurlencode($_GET['no_sharer']) : '')
+                                       . (!empty($_GET['accounttype']) ? '&accounttype=' . rawurlencode($_GET['accounttype']) : '')
                                        . "'; </script>\r\n";
                        }
                } elseif ($mode === self::MODE_PROFILE) {
@@ -530,6 +533,17 @@ class Conversation
                                        . "<script> var profile_uid = " . ($this->session->getLocalUserId() ?: 0) . ";"
                                        . "</script>";
                        }
+               } elseif ($mode === self::MODE_CHANNEL) {
+                       $items = $this->addChildren($items, true, $order, $uid, $mode, $ignoredGsids);
+
+                       if (!$update) {
+                               $live_update_div = '<div id="live-channel"></div>' . "\r\n"
+                                       . "<script> var profile_uid = -1; var netargs = '" . substr($this->args->getCommand(), 8)
+                                       . '?f='
+                                       . (!empty($_GET['no_sharer']) ? '&no_sharer=' . rawurlencode($_GET['no_sharer']) : '')
+                                       . (!empty($_GET['accounttype']) ? '&accounttype=' . rawurlencode($_GET['accounttype']) : '')
+                                       . "'; </script>\r\n";
+                       }
                } elseif ($mode === self::MODE_COMMUNITY) {
                        $items = $this->addChildren($items, true, $order, $uid, $mode, $ignoredGsids);
 
@@ -621,7 +635,7 @@ class Conversation
                                unset($conv_responses['dislike']);
                        }
 
-                       if (in_array($mode, [self::MODE_COMMUNITY, self::MODE_CONTACTS, self::MODE_PROFILE])) {
+                       if (in_array($mode, [self::MODE_CHANNEL, self::MODE_COMMUNITY, self::MODE_CONTACTS, self::MODE_PROFILE])) {
                                $writable = true;
                        } else {
                                $writable = $items[0]['writable'] || ($items[0]['uid'] == 0) && in_array($items[0]['network'], Protocol::FEDERATED);
@@ -918,7 +932,8 @@ class Conversation
                                continue;
                        }
 
-                       if (in_array($row['author-gsid'], $ignoredGsids)
+                       if (
+                               in_array($row['author-gsid'], $ignoredGsids)
                                || in_array($row['owner-gsid'], $ignoredGsids)
                                || in_array($row['causer-gsid'], $ignoredGsids)
                        ) {
@@ -1009,7 +1024,7 @@ class Conversation
                        $items[$key]['user-collapsed-owner']  = !$always_display && in_array($row['owner-id'], $collapses);
 
                        if (
-                               in_array($mode, [self::MODE_COMMUNITY, self::MODE_NETWORK]) &&
+                               in_array($mode, [self::MODE_CHANNEL, self::MODE_COMMUNITY, self::MODE_NETWORK]) &&
                                (in_array($row['author-id'], $blocks) || in_array($row['owner-id'], $blocks) || in_array($row['author-id'], $ignores) || in_array($row['owner-id'], $ignores))
                        ) {
                                unset($items[$key]);