 
 @NSApplicationMain
 public class ParrotAppController: NSApplicationController {
+    
+    let net = NetworkReachabilityManager(host: "google.com")
     
 	/// Lazy-init for the main conversations NSWindowController.
 	private lazy var conversationsController: NSWindowController = {
 		ConversationListViewController()
 	}()
+    
+    private lazy var statusItem: NSStatusItem = {
+        NSStatusBar.system().statusItem(withLength: NSSquareStatusItemLength)
+    }()
 	
 	public override init() {
 		super.init()

	public static let AutoEmoji = "Parrot.AutoEmoji"
	public static let MessageTextSize = "Parrot.MessageTextSize"
	public static let Emoticons = "Parrot.Emoticons"
	public static let Completions = "Parrot.Completions"
	
	public static let VibrateForceTouch = "Parrot.VibrateForceTouch"
	public static let VibrateInterval = "Parrot.VibrateInterval"

                }
            }
        }
        
        /// This setting currently does not exist in the UI. Use `defaults` to set it.
        /// For a menubar-only experience, set the Info.plist `LSUIElement` to YES.
        if Settings[Parrot.MenuBarIcon] != nil {
            let image = NSImage(named: NSImageNameApplicationIcon)
            image?.size = NSSize(width: 16, height: 16)
            statusItem.image = image
            statusItem.button?.target = self
            statusItem.button?.sendAction(on: [.leftMouseUp, .rightMouseUp])
            statusItem.button?.action = #selector(self.showConversationWindow(sender:))
        }
    }
    
    /// Right clicking the status item causes the app to close; left click causes it to become visible.
    func showConversationWindow(sender: NSStatusBarButton?) {
        let event = NSApp.currentEvent!
        if event.type == NSEventType.rightMouseUp {
            NSApp.terminate(self)
        } else {
            DispatchQueue.main.async {
                self.conversationsController.showWindow(nil)
                NSApp.activate(ignoringOtherApps: true)
            }
        }
    }
    
    /// If the Conversations window is closed, tapping the dock icon will reopen it.
    public func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
