aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-07-05 19:05:25 +0200
committerTobias Markmann <tm@ayena.de>2009-07-05 19:05:25 +0200
commitfa97be5e4dcd83cd57c51e764f6aa2a39b9833ba (patch)
tree04f1aa322632a0221c225ee6957b5863755a3b6d /plugins/mod_pep.lua
parent4ce313959b678592a5fe0ef30b6813d058de45af (diff)
parent2c3ccf56744975a5f5acbc66d2e917e056467965 (diff)
downloadprosody-fa97be5e4dcd83cd57c51e764f6aa2a39b9833ba.tar.gz
prosody-fa97be5e4dcd83cd57c51e764f6aa2a39b9833ba.zip
Merge with main branch.
Diffstat (limited to 'plugins/mod_pep.lua')
-rw-r--r--plugins/mod_pep.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 4a8300f1..0be681fb 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -54,8 +54,9 @@ local function publish_all(user, recipient, session)
local d = data[user];
local notify = recipients[user] and recipients[user][recipient];
if d and notify then
- for node, message in pairs(notify) do
- if d[node] then
+ for node in pairs(notify) do
+ local message = d[node];
+ if message then
message.attr.to = recipient;
session.send(message);
end
@@ -101,7 +102,7 @@ module:hook("presence/bare", function(event)
recipients[user] = recipients[user] or {};
if hash_map[hash] then
recipients[user][recipient] = hash_map[hash];
- publish_all(user, recipient);
+ publish_all(user, recipient, origin);
else
recipients[user][recipient] = hash;
origin.send(
@@ -192,7 +193,7 @@ module:hook("iq/bare/disco", function(event)
local notify = {};
for _, feature in pairs(disco.tags) do
if feature.name == "feature" and feature.attr.var then
- local nfeature = feature.attr.var:match("^(.*)+notify$");
+ local nfeature = feature.attr.var:match("^(.*)%+notify$");
if nfeature then notify[nfeature] = true; end
end
end