Diff

plugins/mod_pep.lua @ 1402:34723bbd5acb

mod_pep: Broadcast from the user's bare JID, not full JID
author Waqas Hussain <waqas20@gmail.com>
date Wed, 24 Jun 2009 19:40:12 +0500
parent 1401:a3ce55c1e43a
child 1404:12abd2da8885
line wrap: on
line diff
--- 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