projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mod_uptime: Fix bad uptime if module is loaded at startup
[prosody.git]
/
plugins
/
mod_pep.lua
diff --git
a/plugins/mod_pep.lua
b/plugins/mod_pep.lua
index 4a8300f1d0fc8600bc7021b54658ddff63b25ac6..8cc4aedfb6004a5c85417802c8608273b8a2fc8a 100644
(file)
--- a/
plugins/mod_pep.lua
+++ b/
plugins/mod_pep.lua
@@
-1,3
+1,11
@@
+-- Prosody IM
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
+--
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
local jid_bare = require "util.jid".bare;
local jid_split = require "util.jid".split;
local jid_bare = require "util.jid".bare;
local jid_split = require "util.jid".split;
@@
-54,8
+62,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
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
message.attr.to = recipient;
session.send(message);
end
@@
-101,7
+110,7
@@
module:hook("presence/bare", function(event)
recipients[user] = recipients[user] or {};
if hash_map[hash] then
recipients[user][recipient] = hash_map[hash];
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(
else
recipients[user][recipient] = hash;
origin.send(
@@
-192,7
+201,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 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
if nfeature then notify[nfeature] = true; end
end
end