diff options
author | marijus <mario@localhost.localdomain> | 2014-02-07 21:35:18 +0100 |
---|---|---|
committer | marijus <mario@localhost.localdomain> | 2014-02-07 21:35:18 +0100 |
commit | 4c0f9a91b95025f08e3c4e2739cb5f4186726023 (patch) | |
tree | 3b19b8c3aa086e4931aac9790d298b2306f71ff7 /include/chat.php | |
parent | c26ae94592dda51a40903ea65f117fd7dd9d0ef3 (diff) | |
parent | f62ec4132ed571288737423de386054a4cc8b0d5 (diff) | |
download | volse-hubzilla-4c0f9a91b95025f08e3c4e2739cb5f4186726023.tar.gz volse-hubzilla-4c0f9a91b95025f08e3c4e2739cb5f4186726023.tar.bz2 volse-hubzilla-4c0f9a91b95025f08e3c4e2739cb5f4186726023.zip |
Merge branch 'upstream'
Diffstat (limited to 'include/chat.php')
-rw-r--r-- | include/chat.php | 11 |
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'])); |