stanza_router: Remove the 'to' attribute when it's value is the bare JID of the local user sending the stanza

Wed, 03 Jun 2009 08:00:07 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Wed, 03 Jun 2009 08:00:07 +0500
changeset 1292
b18c1ad7fcb6
parent 1289
d0c38cac1687
child 1293
13dde33d5b87

stanza_router: Remove the 'to' attribute when it's value is the bare JID of the local user sending the stanza

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Tue Jun 02 21:22:24 2009 +0500
+++ b/core/stanza_router.lua	Wed Jun 03 08:00:07 2009 +0500
@@ -149,6 +149,9 @@
 			to_type = '/full';
 		else
 			to_type = '/bare';
+			if node == origin.username and host == origin.host then
+				stanza.attr.to = nil;
+			end
 		end
 	else
 		if host then

mercurial