From e9278eb0a1c0126e6903f333ed4efa5dd00ff5cc Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 16 Aug 2017 21:06:06 +0200 Subject: handlePrivmsg: call out to plugins in QUERY When a PRIVMSG comes in from an individual user instead of a channel, invoke our plugins so we're doing the same thing in both cases. --- src/IRC.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/IRC.hs b/src/IRC.hs index c669f99..b941982 100644 --- a/src/IRC.hs +++ b/src/IRC.hs @@ -36,11 +36,10 @@ handlePrivmsg = IRC.EventHandler , channel = T.unpack nick , nick = T.unpack nick } - Just plugin = matchPlugin message - response <- liftIO $ performPlugin plugin message - IRC.send $ case response of - Left err -> IRC.Privmsg nick (Right (T.pack err)) - Right r -> IRC.Privmsg nick (Right (T.pack r)) + response <- liftIO $ privmsgFromPlugin message + case response of + Nothing -> return () + Just r -> r dispatchEvent (IRC.Event _ (IRC.Channel chan nick) (IRC.Privmsg _ (Right msg))) = do let message = Message -- cgit v1.2.3