MUC: Throw an error if we try talking to ourselves

Fri, 20 Feb 2009 00:51:33 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 20 Feb 2009 00:51:33 +0500
changeset 827
e74045238ee3
parent 826
27978a3f2c0c
child 828
97ea39b7bf90

MUC: Throw an error if we try talking to ourselves

plugins/mod_muc.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_muc.lua	Thu Feb 19 19:00:18 2009 +0000
+++ b/plugins/mod_muc.lua	Fri Feb 20 00:51:33 2009 +0500
@@ -227,6 +227,7 @@
 	local current_nick = jid_nick:get(from, room);
 	local type = stanza.attr.type;
 	log("debug", "room: %s, current_nick: %s, stanza: %s", room or "nil", current_nick or "nil", stanza:top_tag());
+	if (select(2, jid_split(from)) == muc_domain) error("Presence from the MUC itself!!!");
 	if stanza.name == "presence" then
 		local pr = get_filtered_presence(stanza);
 		pr.attr.from = current_nick;

mercurial