From 01e0bc5437d7fa340aca5bdd119bc60dd8be6631 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 27 Jan 2024 13:51:15 +0200 Subject: [PATCH] remove deprecated code --- src/controller/room.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/controller/room.php b/src/controller/room.php index 625908f..16139fa 100644 --- a/src/controller/room.php +++ b/src/controller/room.php @@ -159,7 +159,7 @@ class Room public function posts(string $namespace): ?string { - // Get records by namespace + // Get all records by namespace if (!$records = (array) $this->_records($namespace)) { return null; @@ -168,18 +168,19 @@ class Room // Get posts $posts = []; - foreach ($records as $record) + // Get pending posts + foreach ($this->_pending() as $pending) { - if ($post = $this->_post($namespace, $record['key'], $records, null, $time)) + if ($post = $this->_post($namespace, $pending['key'], $records, null, $time)) { $posts[$time] = $post; } } - // Get pending posts - foreach ($this->_pending() as $pending) + // Get saved posts + foreach ($records as $record) { - if ($post = $this->_post($namespace, $pending['key'], $records, null, $time)) + if ($post = $this->_post($namespace, $record['key'], $records, null, $time)) { $posts[$time] = $post; } @@ -295,12 +296,6 @@ class Room ); // Reset cache - $this->_memory->delete( - [ - 'Kevachat\Geminiapp\Controller\Room::_pending' - ] - ); - $this->_memory->delete( [ 'Kevachat\Geminiapp\Controller\Room::_records',