Minor fix to messages view after merge
Prevent navigation when clicking on workspace button

Switch from trigger to an event. Not sure why the trigger wasn' working
but this works.
Add total_count to messages API
Show post create/edit links on message item if post it is set

Return 'post' in the messages API.
Parse post.id into 'post' in frontend message model
Show / hide post links based on post value.
Further Messages API work

- Allow users to create outgoing message via API
- Check message status based on direction
- Check direction doesn't change after message creation
- Save different message details depending on direction and if the message
  is new.