Sat, 25 May 2013 21:35:27 +0200
plugins.commands: If a message with a [command] was directed at someone, remember their nickname.
plugins/commands.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/commands.lua Sat May 25 21:35:27 2013 +0200 +++ b/plugins/commands.lua Sat May 25 21:35:27 2013 +0200 @@ -19,6 +19,12 @@ if not command then command, hasparam, param = body:match("%[([%a%-%_%d]+)(%s?)(.*)%]"); + if event.room then + local direct_to = body:match"^(.-)[,:]" + if event.room.occupants[direct_to] then + event.reply_to = direct_to + end + end end if hasparam ~= " " then param = nil; end