aboutsummaryrefslogtreecommitdiffstats
path: root/src/IRC.hs
diff options
context:
space:
mode:
authorTeddy Wing2017-08-16 21:06:06 +0200
committerTeddy Wing2017-08-16 21:06:06 +0200
commite9278eb0a1c0126e6903f333ed4efa5dd00ff5cc (patch)
tree69ec0981fc463c0d890d7d5a89a4a8330f80fd1d /src/IRC.hs
parent5a10fc62bfd3c2771ce6f316042479824ef98d17 (diff)
downloadsorbot-e9278eb0a1c0126e6903f333ed4efa5dd00ff5cc.tar.bz2
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.
Diffstat (limited to 'src/IRC.hs')
-rw-r--r--src/IRC.hs9
1 files changed, 4 insertions, 5 deletions
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