diff --git a/template/chat.tpl b/template/chat.tpl
index 18cfe0a..e03b339 100644
--- a/template/chat.tpl
+++ b/template/chat.tpl
@@ -4,7 +4,7 @@
{if $room}{$room} - {/if}{lang}chat.global.title{/lang} - {PAGE_TITLE|language}
{include file='headInclude'}
- {if $room}
+ {if $room && (!$room->maxUsers || $room->getUsers()|count < $room->maxUsers)}
{include file='javascriptInclude' application='chat'}