buddycloud/webclient — pull request #3 by vitoravelino (2012-09-08 17:05:33+00:00)
Title: Posting channel

Some considerations:
- Created a new view for a single post (SinglePost) to avoid PostStream handle all events of a posts and get polluted in future. I know that we loose some performance by using append() instead of a single html(), but we are not going to deal with hundreds of posts after infinite scroll get implemented, right?;
- Because of text plain response of HTTP API 'dataType: text' had to be added to create a new post without parse errors. Backbone is parsing it like every letter is an attribute and making the model dirty. Maybe check if the *resp* is a string and replace it by an empty string?
- Creating a post through HTTP API are causing a 'acct:' prefix to the author
- Post's parse() overridden to set the id and author attributes (the only necessary to have posting and commenting feature working) because HTTP API response does not include the full resource (only the Location) and I didn't think it was a good idea to make another synced request and let the user waiting for that. I thought in doing an async fetch just to have the data synced with the server but I got an Unauthorized response because I didn't pass the credentials. **Any suggestions of how to use the credentials there?**
- Test for parse() is not checking the author because UserCredentials must use sessionStorage setItem and getItem methods instead of object properties.