OR-473 Use event to update the number of unread message
OR-473 $rootScope pubsub to refresh the number of unread messages when user click on load messages
OR-473 Extract functions
OR-473 Add test for event
Merge pull request #365 in OR/rse from OR/rse-chamerling:OR-473-event-update-unread to master

* commit '84c53816769bfb8bab329b6ffa1075e2da6e5681':
  OR-473 Add test for event
  OR-473 Extract functions
  OR-473 $rootScope pubsub to refresh the number of unread messages when user click on load messages
  OR-473 Use event to update the number of unread message