# HG changeset patch # User Kim Alvefur # Date 1299691672 -3600 # Node ID 12e2c702eddcbdd8ff2c5901aa92d1c227a5d38d # Parent bdaf81ab55ad355a049dbd2e53e855b751c4b05b plugins.groupchat: Optimize reply nick prefixing and prevent a traceback diff -r bdaf81ab55ad -r 12e2c702eddc plugins/groupchat.lua --- a/plugins/groupchat.lua Wed Mar 09 18:18:41 2011 +0100 +++ b/plugins/groupchat.lua Wed Mar 09 18:27:52 2011 +0100 @@ -47,7 +47,7 @@ if not reply then reply = "Nothing to say to you"; end if replied then return false; end replied = true; - if r.attr.type == "groupchat" and reply:sub(1,4) ~= "/me " then + if reply:sub(1,4) ~= "/me " and event.sender and r.attr.type == "groupchat" then reply = event.sender.nick..": "..reply; end room:send(r:tag("body"):text(reply));