[PLUGIN][TreeNotes] Correct cache issues and iterate functionality

- Replies ordering now correct
- Replies count added
- Posting adds new replies to cache (when concerning replies cache is not empty) and increments replies count
- Configuration to specify number of in-tree replies shown added
- TreeNotes templates was moved from core to plugin
- Button to read more replies was added
This commit is contained in:
2022-02-27 00:42:59 +00:00
parent 2f539d176d
commit a9b34b75b6
9 changed files with 111 additions and 38 deletions

View File

@@ -265,6 +265,14 @@ class Note extends Model
// Assign conversation to this note
Conversation::assignLocalConversation($obj, $reply_to);
// Update replies cache
if (!\is_null($reply_to)) {
Cache::incr(GSNote::cacheKeys($reply_to)['replies-count']);
if (Cache::exists(GSNote::cacheKeys($reply_to)['replies'])) {
Cache::listPushRight(GSNote::cacheKeys($reply_to)['replies'], $obj);
}
}
$object_mention_ids = [];
foreach ($type_note->get('tag') ?? [] as $ap_tag) {
switch ($ap_tag->get('type')) {