diff options
author | Teddy Wing | 2017-08-16 21:06:06 +0200 |
---|---|---|
committer | Teddy Wing | 2017-08-16 21:06:06 +0200 |
commit | e9278eb0a1c0126e6903f333ed4efa5dd00ff5cc (patch) | |
tree | 69ec0981fc463c0d890d7d5a89a4a8330f80fd1d | |
parent | 5a10fc62bfd3c2771ce6f316042479824ef98d17 (diff) | |
download | sorbot-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.
-rw-r--r-- | src/IRC.hs | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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 |