mod_pep: Broadcast from the user's bare JID, not full JID

Wed, 24 Jun 2009 19:40:12 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Wed, 24 Jun 2009 19:40:12 +0500
changeset 1402
34723bbd5acb
parent 1401
a3ce55c1e43a
child 1403
a1762cfd4d83

mod_pep: Broadcast from the user's bare JID, not full JID

plugins/mod_pep.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_pep.lua	Wed Jun 24 19:38:28 2009 +0500
+++ b/plugins/mod_pep.lua	Wed Jun 24 19:40:12 2009 +0500
@@ -17,14 +17,14 @@
 
 local function publish(session, node, item)
 	local disable = #item.tags ~= 1 or #item.tags[1].tags == 0;
-	local stanza = st.message({from=session.full_jid, type='headline'})
+	local bare = session.username..'@'..session.host;
+	local stanza = st.message({from=bare, type='headline'})
 		:tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'})
 			:tag('items', {node=node})
 				:add_child(item)
 			:up()
 		:up();
 
-	local bare = session.username..'@'..session.host;
 	-- store for the future
 	local user_data = data[bare];
 	if disable then

mercurial