mod_storage_*: Don't explicitly set driver name, to ease copying/renaming modules.
[prosody.git] / plugins / mod_pep.lua
index bd6f4b29b8a89e6139d826149ddda18eee4795d3..c2261e5f6534ee25480f444904df6d4c49ed28a6 100644 (file)
@@ -17,6 +17,7 @@ local pairs, ipairs = pairs, ipairs;
 local next = next;
 local type = type;
 local calculate_hash = require "util.caps".calculate_hash;
+local core_post_stanza = prosody.core_post_stanza;
 
 local NULL = {};
 local data = {};
@@ -32,7 +33,7 @@ module.restore = function(state)
        hash_map = state.hash_map or {};
 end
 
-module:add_identity("pubsub", "pep", "Prosody");
+module:add_identity("pubsub", "pep", module:get_option_string("name", "Prosody"));
 module:add_feature("http://jabber.org/protocol/pubsub#publish");
 
 local function subscription_presence(user_bare, recipient)
@@ -136,8 +137,9 @@ module:hook("presence/bare", function(event)
                                        recipients[user][recipient] = hash;
                                        local from_bare = origin.type == "c2s" and origin.username.."@"..origin.host;
                                        if self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then
+                                               -- COMPAT from ~= stanza.attr.to because OneTeam can't deal with missing from attribute
                                                origin.send(
-                                                       st.stanza("iq", {from=stanza.attr.to, to=stanza.attr.from, id="disco", type="get"})
+                                                       st.stanza("iq", {from=user, to=stanza.attr.from, id="disco", type="get"})
                                                                :query("http://jabber.org/protocol/disco#info")
                                                );
                                        end