Sent "Visitor closed chat window" message only if there was a chat
Move group related functions to libs/groups.php
Add "groupUpdate" event
Add one more group parameter to check
Pass regular group array to "create_group" and "update_group" functions
Use named placeholders in "update_group" function