Add support for interaction in queries

This commit is contained in:
Jonas Höglund 2014-06-06 09:25:38 +02:00
parent 578d43f7c4
commit e0b8fe3c86
1 changed files with 5 additions and 4 deletions

View File

@ -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").
putstrln("done").