                 delivery_medium = null
                 client.sendchatmessage(conv_id, segs, image_id, otr, client_generated_id, delivery_medium, message_action_type).then (r) ->
                       # console.log 'sendchatmessage:result', r?.created_event?.self_event_state?.client_generated_id
-                      ipcsend 'sendchatmessage:result', r
-                      resolve()
+                    ipcsend 'sendchatmessage:result', r
+                    resolve()
             attempt()
         messageQueue = messageQueue.then ->
             sendForSure()

    , false, (ev, conv_id, timestamp, max) -> conv_id

    ipc.on 'togglefullscreen', ->
      mainWindow.setFullScreen not mainWindow.isFullScreen()

    # bye bye
    ipc.on 'logout', logout

        # reinstate app window when login finishes
        prom = login(loginWindow)
        .then (rs) ->
            global.forceClose = true
            loginWindow.removeAllListeners 'closed'
            loginWindow.close()
            mainWindow.show()
            rs
        auth: -> prom

    # sends the init structures to the client
