aboutsummaryrefslogtreecommitdiffstats
path: root/include/chat.php
diff options
context:
space:
mode:
authormarijus <mario@localhost.localdomain>2014-02-07 13:50:18 +0100
committermarijus <mario@localhost.localdomain>2014-02-07 13:50:18 +0100
commit6dd05bb53fb7892a386740f6ee246649f6f70e1e (patch)
treecb959c7969402bcc3a70acfb5088ec34f43402f5 /include/chat.php
parent6f2c168d1a434b2223f09a922780617fdc07b278 (diff)
parentc80325b4279b6f19540416064382755ca5e6eccd (diff)
downloadvolse-hubzilla-6dd05bb53fb7892a386740f6ee246649f6f70e1e.tar.gz
volse-hubzilla-6dd05bb53fb7892a386740f6ee246649f6f70e1e.tar.bz2
volse-hubzilla-6dd05bb53fb7892a386740f6ee246649f6f70e1e.zip
Merge branch 'master' of https://github.com/friendica/red into upstream
Diffstat (limited to 'include/chat.php')
-rw-r--r--include/chat.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/chat.php b/include/chat.php
index 5af3a3a9a..fb1d4fe65 100644
--- a/include/chat.php
+++ b/include/chat.php
@@ -114,6 +114,17 @@ function chatroom_enter($observer_xchan,$room_id,$status,$client) {
return false;
}
+ $limit = service_class_fetch($r[0]['cr_uid'],'chatters_inroom');
+ if($limit !== false) {
+ $x = q("select count(*) as total from chatpresence where cp_room = %d",
+ intval($room_id)
+ );
+ if($x && $x[0]['total'] > $limit) {
+ notice( t('Room is full') . EOL);
+ return false;
+ }
+ }
+
if(intval($x[0]['cr_expire']))
$r = q("delete from chat where created < UTC_TIMESTAMP() - INTERVAL " . intval($x[0]['cr_expire']) . " MINUTE and chat_room = " . intval($x[0]['cr_id']));