From 90e781c80315f83a7e26cf9d87fc8e5bb0d4c197 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 25 Jan 2024 21:34:57 +0200 Subject: [PATCH] add subject support --- src/controller/room.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/controller/room.php b/src/controller/room.php index 557e5d4..6c94fd8 100644 --- a/src/controller/room.php +++ b/src/controller/room.php @@ -136,6 +136,18 @@ class Room public function posts(string $namespace): ?string { + // Get subject + $subject = null; + + foreach ((array) $this->_kevacoin->kevaListNamespaces() as $record) + { + if ($record['namespaceId'] == $namespace) + { + $subject = $record['displayName']; + } + } + + // Get posts $posts = []; foreach ((array) $this->_kevacoin->kevaFilter($namespace) as $record) @@ -161,7 +173,7 @@ class Room file_get_contents( __DIR__ . '/../../logo.ascii' ), - $namespace, + $subject ? $subject : $namespace, implode( PHP_EOL, $posts