-- | On the first message from NickServ, whatever it is, identify for our nick.
nickservIdent :: SEvent -> Bot ()
nickservIdent (SNotice sender@(SUser _ _ _) _ _) = do
    nsAddr <- getGlobal' nickservAddr
    nsPass <- getGlobal' identPassword
    if sender /= nsAddr || nsAddr == SServer "" || nsPass == "" then return ()
    else do
        getGlobal handleNickservNotice >>= removeCallback
        sendMessage (fromS sender :: User) ("IDENTIFY "++nsPass)

-- | When we successfully identify for our nick, we want to request
-- op from ChanServ, in case any ops depended on being identified.
nickservIdent :: SEvent -> Bot ()
nickservIdent (SNotice sender@(SUser _ _ _) _ _) = do
    nsAddr <- getGlobal' nickservAddr
    nsPass <- getGlobal' identPassword
    if sender /= nsAddr || nsAddr == SServer "" || nsPass == "" then return ()
    else do
        getGlobal handleNickservNotice >>= removeCallback
        sendMessage (fromS sender :: User) ("IDENTIFY "++nsPass)

-- | When we successfully identify for our nick, we want to request
-- op from ChanServ, in case any ops depended on being identified.
nickservIdent (SNotice sender@(SUser _ _ _) _ _) = do
    nsAddr <- getGlobal' nickservAddr
    nsPass <- getGlobal' identPassword
    if sender /= nsAddr || nsAddr == SServer "" || nsPass == "" then return ()
    else do
        getGlobal handleNickservNotice >>= removeCallback
        sendMessage (fromS sender :: User) ("IDENTIFY "++nsPass)

-- | When we successfully identify for our nick, we want to request
-- op from ChanServ, in case any ops depended on being identified.