|
|
@ -70,7 +70,7 @@ class ModuleController extends AbstractController |
|
|
|
$name = $value['displayName']; |
|
|
|
$name = $value['displayName']; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Check namespace enabled as room in settings |
|
|
|
// Check namespace enabled as room in .env |
|
|
|
if (in_array($value['namespaceId'], $rooms)) |
|
|
|
if (in_array($value['namespaceId'], $rooms)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$list[$value['namespaceId']] = $value['displayName']; |
|
|
|
$list[$value['namespaceId']] = $value['displayName']; |
|
|
@ -95,6 +95,7 @@ class ModuleController extends AbstractController |
|
|
|
Request $request |
|
|
|
Request $request |
|
|
|
): Response |
|
|
|
): Response |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
// Connect wallet |
|
|
|
$client = new \Kevachat\Kevacoin\Client( |
|
|
|
$client = new \Kevachat\Kevacoin\Client( |
|
|
|
$this->getParameter('app.kevacoin.protocol'), |
|
|
|
$this->getParameter('app.kevacoin.protocol'), |
|
|
|
$this->getParameter('app.kevacoin.host'), |
|
|
|
$this->getParameter('app.kevacoin.host'), |
|
|
@ -103,18 +104,26 @@ class ModuleController extends AbstractController |
|
|
|
$this->getParameter('app.kevacoin.password') |
|
|
|
$this->getParameter('app.kevacoin.password') |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get room settings |
|
|
|
|
|
|
|
$rooms = explode('|', $this->getParameter('app.kevacoin.room.namespaces')); |
|
|
|
|
|
|
|
$readonly = explode('|', $this->getParameter('app.kevacoin.room.namespaces.readonly')); |
|
|
|
|
|
|
|
|
|
|
|
// Get wallet namespaces (to enable post module there) |
|
|
|
// Get wallet namespaces (to enable post module there) |
|
|
|
$namespaces = []; |
|
|
|
$public = []; |
|
|
|
|
|
|
|
|
|
|
|
foreach ((array) $client->kevaListNamespaces() as $value) |
|
|
|
foreach ((array) $client->kevaListNamespaces() as $value) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$namespaces[] = $value['namespaceId']; |
|
|
|
// Check namespace enabled as room in .env |
|
|
|
|
|
|
|
if (in_array($value['namespaceId'], $rooms) && !in_array($value['namespaceId'], $readonly)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$public[] = $value['namespaceId']; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
return $this->render( |
|
|
|
'default/module/post.html.twig', |
|
|
|
'default/module/post.html.twig', |
|
|
|
[ |
|
|
|
[ |
|
|
|
'enabled' => in_array($request->get('namespace'), $namespaces), |
|
|
|
'enabled' => in_array($request->get('namespace'), $public), |
|
|
|
'namespace' => $request->get('namespace'), |
|
|
|
'namespace' => $request->get('namespace'), |
|
|
|
'message' => $request->get('message'), |
|
|
|
'message' => $request->get('message'), |
|
|
|
'user' => $request->get('user'), |
|
|
|
'user' => $request->get('user'), |
|
|
|