From e55c192465fb55cdaee01cb91e2f0e274778c5e6 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 29 Jul 2009 17:57:24 +0500 Subject: mod_pep: Added support for pubsub item retraction --- plugins/mod_pep.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 8cc4aedf..768d4a4a 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -30,6 +30,7 @@ module:add_feature("http://jabber.org/protocol/pubsub#publish"); local function publish(session, node, item) local disable = #item.tags ~= 1 or #item.tags[1].tags == 0; + if #item.tags == 0 then item.name = "retract"; end local bare = session.username..'@'..session.host; local stanza = st.message({from=bare, type='headline'}) :tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'}) @@ -128,7 +129,7 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event) local payload = stanza.tags[1]; if payload.name == 'pubsub' then -- payload = payload.tags[1]; - if payload and payload.name == 'publish' and payload.attr.node then -- + if payload and (payload.name == 'publish' or payload.name == 'retract') and payload.attr.node then -- local node = payload.attr.node; payload = payload.tags[1]; if payload then -- -- cgit v1.2.3 From f72cd22f0ce3697c8239d59ba0e0355c2963e5b7 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 29 Jul 2009 18:01:14 +0500 Subject: Added: Support for PROSODY_SRCDIR and PROSODY_PLUGINDIR environment variables --- prosody | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prosody b/prosody index b6247f21..4984ed15 100755 --- a/prosody +++ b/prosody @@ -9,9 +9,9 @@ -- Will be modified by configure script if run -- -CFG_SOURCEDIR=nil; +CFG_SOURCEDIR=os.getenv("PROSODY_SRCDIR"); CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR"); -CFG_PLUGINDIR=nil; +CFG_PLUGINDIR=os.getenv("PROSODY_PLUGINDIR"); CFG_DATADIR=os.getenv("PROSODY_DATADIR"); -- -- -- -- -- -- -- ---- -- -- -- -- -- -- -- -- -- cgit v1.2.3 From 273fa0fd8ac62a9f877033c659596fac911b4717 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 29 Jul 2009 18:02:05 +0500 Subject: MUC: Added the MUC child element to conflict errors --- util/muc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/muc.lua b/util/muc.lua index b3673f63..badcffce 100644 --- a/util/muc.lua +++ b/util/muc.lua @@ -209,7 +209,7 @@ local function room_handle_to_occupant(self, origin, stanza) -- PM, vCards, etc else -- change nick if self._participants[to] then log("debug", "%s couldn't change nick", current_nick); - origin.send(st.error_reply(stanza, "cancel", "conflict")); + origin.send(st.error_reply(stanza, "cancel", "conflict"):tag("x", {xmlns = "http://jabber.org/protocol/muc"})); else local data = self._participants[current_nick]; local to_nick = select(3, jid_split(to)); @@ -240,7 +240,7 @@ local function room_handle_to_occupant(self, origin, stanza) -- PM, vCards, etc end if not new_nick then log("debug", "%s couldn't join due to nick conflict: %s", from, to); - origin.send(st.error_reply(stanza, "cancel", "conflict")); + origin.send(st.error_reply(stanza, "cancel", "conflict"):tag("x", {xmlns = "http://jabber.org/protocol/muc"})); else log("debug", "%s joining as %s", from, to); local data; -- cgit v1.2.3