plugins.groupchat: Optimize reply nick prefixing and prevent a traceback

Wed, 09 Mar 2011 18:27:52 +0100

author
Kim Alvefur <zash@zash.se>
date
Wed, 09 Mar 2011 18:27:52 +0100
changeset 67
12e2c702eddc
parent 66
bdaf81ab55ad
child 68
f388a8a57d1d

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));

mercurial