 
   mapChannel = (channel) ->
     { socialapi } = kd.singletons
-
+    
     data  = channel.channel
 
     # hold state of cache hit


    # item is initially our data
    item = data

    # if we find the channel in cache, replace item with it
    if cacheItem = socialapi.retrieveCachedItem item.typeConstant, item.id
      cacheFound = yes

    item.participantsPreview = mapAccounts channel.participantsPreview
    item.unreadCount         = channel.unreadCount
    item.lastMessage         = mapActivity channel.lastMessage  if channel.lastMessage
        
    unless cacheFound 
      channelInstance = new remote.api.SocialChannel item
    else 
      channelInstance = item

    kd.singletons.socialapi.cacheItem channelInstance
