aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-12-21 06:26:37 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-12-21 06:26:37 +0500
commitc21f22df8d91e3c14205a54eeaa0deb124d2b288 (patch)
tree0122591b72ed54ed147c366a030e5a434ec2baee /plugins
parent0453ec49b81705e71558828c349dafd4745c8dc3 (diff)
downloadprosody-c21f22df8d91e3c14205a54eeaa0deb124d2b288.tar.gz
prosody-c21f22df8d91e3c14205a54eeaa0deb124d2b288.zip
mod_pep: Handle service discovery queries for bare account JIDs (thanks darkrain).
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_pep.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index ef03ab0f..b2f2f8f3 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -277,3 +277,21 @@ module:hook("iq/bare/disco", function(event)
end
end
end);
+
+module:hook("account-disco-info", function(event)
+ local stanza = event.stanza;
+ stanza:tag('identity', {category='pubsub', type='pep'}):up();
+ stanza:tag('feature', {var='http://jabber.org/protocol/pubsub#publish'}):up();
+end);
+
+module:hook("account-disco-items", function(event)
+ local session, stanza = event.session, event.stanza;
+ local bare = session.username..'@'..session.host;
+ local user_data = data[bare];
+
+ if user_data then
+ for node, _ in pairs(user_data) do
+ stanza:tag('item', {jid=bare, node=node}):up();
+ end
+ end
+end);