Added logic for message, notification and friend