]> git.mxchange.org Git - friendica.git/commitdiff
Use group posts for channels
authorMichael <heluecht@pirati.ca>
Sat, 2 Sep 2023 06:38:05 +0000 (06:38 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 2 Sep 2023 06:38:05 +0000 (06:38 +0000)
src/Model/Post/Engagement.php
src/Module/Conversation/Channel.php

index 8c9ce1537a17f07815ccd6e8b7e313bcd871a1f0..55c5b3ba1c712972ed9d078c09bae66b822a091e 100644 (file)
@@ -65,11 +65,6 @@ class Engagement
                        return;
                }
 
-               if ($parent['contact-contact-type'] == Contact::TYPE_COMMUNITY) {
-                       Logger::debug('Group posts are not stored', ['uri-id' => $item['uri-id'], 'parent-uri-id' => $item['parent-uri-id'], 'author-id' => $parent['author-id']]);
-                       return;
-               }
-
                if ($parent['created'] < DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour')) {
                        Logger::debug('Post is too old', ['uri-id' => $item['uri-id'], 'parent-uri-id' => $item['parent-uri-id'], 'created' => $parent['created']]);
                        return;
index 3bb8b6039738e92554a8973f618e2bb2bc9fd76b..972c8891a5231e9e8c3653a4a49442a66afea744 100644 (file)
@@ -236,12 +236,12 @@ class Channel extends BaseModule
        protected static function getItems()
        {
                if (self::$content == self::WHATSHOT) {
-                       $post     = DBA::selectToArray('post-engagement', ['comments'], [], ['order' => ['comments' => true], 'limit' => [DI::config()->get('channel', 'hot_posts_item_limit'), 1]]);
+                       $post     = DBA::selectToArray('post-engagement', ['comments'], ["`contact-type` != ?", Contact::TYPE_COMMUNITY], ['order' => ['comments' => true], 'limit' => [DI::config()->get('channel', 'hot_posts_item_limit'), 1]]);
                        $comments = $post[0]['comments'] ?? 0;
                        if (!is_null(self::$accountType)) {
                                $condition = ["`comments` >= ? AND `contact-type` = ?", $comments, self::$accountType];
                        } else {
-                               $condition = ["`comments` >= ?", $comments];
+                               $condition = ["`comments` >= ? AND `contact-type` != ?", $comments, Contact::TYPE_COMMUNITY];
                        }
                } elseif (self::$content == self::FORYOU) {
                        $cid = Contact::getPublicIdByUserId(DI::userSession()->getLocalUserId());