# HG changeset patch # User Kim Alvefur # Date 1369510527 -7200 # Node ID b7c9a3707e682469669b3ffeed4fe68d8a2cc9fd # Parent 7d75d7f9d5aed356fe684caafd57f0e832fe6cce plugins.commands: If a message with a [command] was directed at someone, remember their nickname. diff -r 7d75d7f9d5ae -r b7c9a3707e68 plugins/commands.lua --- 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