diff --git a/src/controller/room.php b/src/controller/room.php index 09c7ff6..909b5c5 100644 --- a/src/controller/room.php +++ b/src/controller/room.php @@ -149,7 +149,7 @@ class Room return null; } - // Get posts + // Get saved posts $posts = []; foreach ($records as $record) @@ -160,6 +160,34 @@ class Room } } + // Get pending posts + foreach ((array) $this->_kevacoin->kevaPending() as $pending) + { + // Ignore pending posts from other rooms + if ($pending['namespace'] != $namespace) + { + continue; + } + + // Ignore everything in pending queue but keva_put + if ($pending['op'] != 'keva_put') + { + continue; + } + + // Skip meta + if (str_starts_with($pending['key'], '_')) + { + continue; + } + + // Require valid kevachat post + if ($post = $this->_post($namespace, $pending['key'], $records, null, $time)) + { + $posts[$time] = $post; + } + } + // Sort posts by time krsort($posts);