             hiddenHandle: yes
           mainView.inboxMessagesContainer.addPane paneView
           detail = new InboxMessageDetail cssClass : "message-detail", data
-          
+
           detail.registerListener
             KDEventTypes: 'viewAppended'
             listener: @
             callback: =>
               data.restComments 0, (err, comments)-> # log arguments, data
-          
+
           paneView.addSubView detail
           paneView.detail = detail
           item.paneView = paneView
 
         @selectMessage data, item, paneView
-      
+
     {newMessageBar} = mainView
 
     newMessageBar.registerListener
       KDEventTypes  : "AutoCompleteNeedsMemberData"
       listener      : @
-      callback      : (pubInst,event)=> 
+      callback      : (pubInst,event)=>
         {callback,inputValue,blacklist} = event
         @fetchAutoCompleteForToField inputValue,blacklist,callback
 
     newMessageBar.registerListener
       KDEventTypes  : 'MessageShouldBeSent'
       listener      : @
-      callback      : (pubInst,{formOutput,callback})-> 
+      callback      : (pubInst,{formOutput,callback})->
         @prepareMessage formOutput,callback
 
     newMessageBar.registerListener
       KDEventTypes: 'MessageShouldBeDisowned'
       listener    : @
       callback    : do=>
+        if not @selection
+          newMessageBar.disableMessageActionButtons()
+          modal.destroy()
+          return
         disownAll = (items, callback)->
           disownItem = race (i, item, fin)->
             item.data.disown (err)->

    #     {reply, message} = options
    #     message.reply reply, (err)->
    #       console.log err
    
    mainView.registerListener
      KDEventTypes      : 'NotificationIsSelected'
      listener          : @

      options :
        name : 'Inbox'
      data : @mainView

  initAndBringToFront:(options,callback)->
    initApplication options, ->
      @bringToFront()
      callback()

  initApplication:(options, callback)->
    callback()

  fetchMessages:(options, callback)->
    # log "FETCH MESSAGES INTERNAL"
    {currentDelegate} = KD.getSingleton('mainController').getVisitor()
    currentDelegate.fetchMail? options, callback

  fetchAutoCompleteForToField:(inputValue,blacklist,callback)->
    bongo.api.JAccount.byRelevance inputValue,{blacklist},(err,accounts)->
      callback accounts

  loadView:(mainView)->
    mainView.createCommons()
    mainView.createTabs()

    {currentDelegate} = KD.getSingleton('mainController').getVisitor()

    # currentDelegate.fetchPrivateChannel (err, channel)->
    #   console.log channel

    # mainView.inboxMessagesList.on 'ReceivedClickElsewhere', =>
    #   @deselectMessages()
