plugins.groupchat: Set a to attribute on stanzas to rooms if there isn't one

Thu, 11 Nov 2010 03:09:06 +0100

author
Kim Alvefur <zash@zash.se>
date
Thu, 11 Nov 2010 03:09:06 +0100
changeset 44
8e508f08cc7f
parent 43
dd99a0dde016
child 45
aa797b0a98e7
child 51
c93cae5fe3dc

plugins.groupchat: Set a to attribute on stanzas to rooms if there isn't one

plugins/groupchat.lua file | annotate | diff | comparison | revisions
--- a/plugins/groupchat.lua	Tue Nov 09 17:57:44 2010 +0100
+++ b/plugins/groupchat.lua	Thu Nov 11 03:09:06 2010 +0100
@@ -107,7 +107,7 @@
 	if stanza.name == "message" and not stanza.attr.type then
 		stanza.attr.type = "groupchat";
 	end
-	if stanza.attr.type == "groupchat" then
+	if stanza.attr.type == "groupchat" or not stanza.attr.to then
 		stanza.attr.to = self.jid;
 	end
 	self.bot:send(stanza);

mercurial