Permalink
Browse files

Add posted tweets to feed.

  • Loading branch information...
1 parent 06af454 commit 56a4fee2df466b2f9b59b935157452848fe5d828 @paulmillr paulmillr committed Apr 9, 2012
Showing with 5 additions and 0 deletions.
  1. +1 −0 app/models/status.coffee
  2. +4 −0 app/models/tweets.coffee
View
@@ -18,5 +18,6 @@ module.exports = class Status extends Model
timeout = setTimeout options.error.bind(options, 'Timeout error'), 4000
provider.T.Status.update model.get('text'), (tweet) =>
window.clearTimeout(timeout)
+ mediator.publish 'tweet:add', tweet.attributes
options.success(tweet.attributes)
return
View
@@ -14,6 +14,7 @@ module.exports = class Tweets extends Collection
@getTweets()
@subscribeEvent 'login', @getTweets
@subscribeEvent 'logout', @reset
+ @subscribeEvent 'tweet:add', @addTweet
getTweets: ->
console.debug 'Tweets#getTweets'
@@ -43,3 +44,6 @@ module.exports = class Tweets extends Collection
# Resolve the Deferred
@resolve()
+
+ addTweet: (tweet) =>
+ @add tweet, at: 0

0 comments on commit 56a4fee

Please sign in to comment.