Saving chat messages to db. Notification when a user is disconnected.