From e0b8fe3c867a9dd3e687a3c8c2a664c42c3ac81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=B6glund?= Date: Fri, 6 Jun 2014 09:25:38 +0200 Subject: [PATCH] Add support for interaction in queries --- irc.lamb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/irc.lamb b/irc.lamb index 4da4384..a0b7868 100644 --- a/irc.lamb +++ b/irc.lamb @@ -202,10 +202,11 @@ handleCommand(s, user, "JOIN", [chan]) -> do s end. -handleCommand(s, user, "PRIVMSG", [chan, msg]) -> do +handleCommand(s, user, "PRIVMSG", [recipient, msg]) -> do nick = ircnick(user); - putstrln(chan + " " + "<" + nick + "> " + msg); - handleMessage(s, nick, chan, msg) + target = if recipient != NICK then recipient else nick; + putstrln(target + " " + "<" + nick + "> " + msg); + handleMessage(s, nick, target, msg) end. -- nick list @@ -268,4 +269,4 @@ initialState = (loadFactoids(),). putstrln("beginning mainloop"). loop(mainloop, initialState). fclose(sock). -putstrln("done"). \ No newline at end of file +putstrln("done").