 AppFlux              = require 'app/flux'
 actions              = require '../actiontypes'
 isPublicChannel      = require 'app/util/isPublicChannel'
-desktopNotifications = require './desktopnotifications'
 
 dispatch = (args...) -> kd.singletons.reactor.dispatch args...
 

  kd.singletons.socialapi.onChannelReady channel, ->

    channel.on 'MessageAdded', (message) ->

      unless _isChannelInitiationEvent message
        desktopNotifications.postMessageReceivedNotification message, channel

      bindMessageEvents message


  kd.singletons.notificationController
    .on 'MessageAddedToChannel', (payload) ->
      { channel : { id, name, typeConstant }, channelMessage, unreadCount } = payload

      # TODO: FIXME
      # The reason we are doing these extra fetches is that right now backend
