From a4b7708483dd32bc7256288faefa300d3fc13f7b Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 24 Jan 2019 15:15:58 +0100 Subject: Reaktor.Plugins.System: release -> regain --- src/Reaktor.hs | 2 +- src/Reaktor/Plugins/Register.hs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Reaktor.hs b/src/Reaktor.hs index 77db22c..3f968ac 100644 --- a/src/Reaktor.hs +++ b/src/Reaktor.hs @@ -160,7 +160,7 @@ logMsgFilter = \case Message p "PRIVMSG" ["NickServ",xs] | check -> do Just (Message p "PRIVMSG" ["NickServ",xs']) where - check = elem cmd ["IDENTIFY","RELEASE"] && length ws > 2 + check = elem cmd ["IDENTIFY","REGAIN"] && length ws > 2 ws = BS.words xs (cmd:ws') = ws (nick:_) = ws' diff --git a/src/Reaktor/Plugins/Register.hs b/src/Reaktor/Plugins/Register.hs index ec3a11e..0809006 100644 --- a/src/Reaktor/Plugins/Register.hs +++ b/src/Reaktor/Plugins/Register.hs @@ -51,8 +51,8 @@ new Config{..} Actions{..} = do isNickServEnabled = aIsSecure && isJust cNickServ Just ConfigNickServ{..} = cNickServ - release nick pass = do - aSend (privmsg "NickServ" ["RELEASE", nick, pass]) + regain nick pass = do + aSend (privmsg "NickServ" ["REGAIN", nick, pass]) channelsArg = BS.intercalate "," cChannels -- TODO make this similar to privmsg (i.e. don't aSend) @@ -112,7 +112,7 @@ new Config{..} Actions{..} = do Message _ "001" [msgtarget,_text] -> do nick <- aGetNick aSend (privmsg "NickServ" ["IDENTIFY", nick, pass]) - when (msgtarget /= nick) (release nick pass) + when (msgtarget /= nick) (regain nick pass) -- TODO structured prefix, and check just for "NickServ"? Message (Just prefix) "NOTICE" (msgtarget:text:[]) -> @@ -124,9 +124,6 @@ new Config{..} Actions{..} = do -- otherwise join at NICK when (msgtarget == nick) join - | text == stx nick <> " has been released." -> do - aSend (Message Nothing "NICK" [nick]) - | text == "Invalid password for " <> stx nick <> "." -> do -- TODO warning when (msgtarget == nick) join @@ -153,6 +150,6 @@ new Config{..} Actions{..} = do when (res == nick) $ case msgtarget of "*" -> useNextNickTemporarily - _ -> release nick pass + _ -> regain nick pass _ -> pure () -- cgit v1.2.3