psybuzz/goldenconversations — pull request #29 by psybuzz (2014-09-21 06:51:45+00:00)
Title: First pass at leave functionality

This PR adds a new API method: "/conversation/leave" that takes POST requests from users. The purpose of this function is to allow users to leave a given conversation.

On the backend, most of the code should be similar to the 'delete' function in conversation.js. It has been repurposed to only remove a single user from the conversation instead of all. Once the number of participants is 0, the conversation itself and associated posts are deleted.

On the frontend, the choice modal's submit event is registered to make a POST request to "/conversation/leave" if the modal was opened by clicking on the leave link.