 
   accountAddedToChannel: (update) ->
 
-    {socialapi} = KD.singletons
-    {id}        = update.channel
+    {socialapi}   = KD.singletons
+    {unreadCount} = update
+    {id}          = update.channel
 
     socialapi.cacheable 'channel', id, (err, channel) =>
 
       return KD.showError err  if err
 
-      @addItem channel, yes
-      # @updateTopicFollowButtons id, yes  if channel.typeConstant is 'topic'
+      item = @addItem channel, yes
+      item.setUnreadCount unreadCount or 1
 
 
   accountRemovedFromChannel: (update) ->

      .on 'MessageListUpdated',        (update) -> log update.event, update
      .on 'ReplyRemoved',              (update) -> log update.event, update

      # .on 'ChannelUpdateHappened',     @bound 'channelUpdateHappened'


  # event handling

  messageAddedToChannel: (update) ->
    if update.channel.typeConstant is 'pinnedactivity'
      @replyAdded update

  messageRemovedFromChannel: (update)->
    log 'messageRemovedFromChannel', update
    {id} = update.channelMessage

    @removeItem id


  replyAdded: (update) ->

    {id, typeConstant} = update.channel

    @removeItem id


  channelUpdateHappened: (update) ->

    log 'dont use this, educational purposes only!', update

    # @setChannelUnreadCount update  if update.channel

