diff -r 89add07d6fe4 -r cca972635e5e mcabbot.lua --- a/mcabbot.lua Sun Apr 11 18:13:18 2010 +0200 +++ b/mcabbot.lua Sun Apr 11 22:03:12 2010 +0200 @@ -11,7 +11,7 @@ mcabbot.nickname = "McBot" mcabbot.jid = "mcabbot@lilotux.net" -function mcabbot.message_in (h) +local function hk_message_in (h) local perso = false local muc = false local message = h.message @@ -36,7 +36,9 @@ else cmd = "say_to -q "..h.jid.."/"..h.resource.." " end - local res, errmsg = process(message, mcabbot.nickname, muc) + mcabbot.message = h + local res, errmsg = process(message, mcabbot, muc) + mcabbot.message = nil if res then msg = res elseif errmsg then @@ -46,4 +48,4 @@ end end -main.hook("hook-post-message-in", mcabbot.message_in) +main.hook("hook-post-message-in", hk_message_in)