Wed, 09 Mar 2011 18:27:52 +0100
plugins.groupchat: Optimize reply nick prefixing and prevent a traceback
plugins/groupchat.lua | file | annotate | diff | comparison | revisions |
--- 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));