Merge 0.10->trunk
authorKim Alvefur <zash@zash.se>
Sun, 12 Jun 2016 18:06:30 +0000 (20:06 +0200)
committerKim Alvefur <zash@zash.se>
Sun, 12 Jun 2016 18:06:30 +0000 (20:06 +0200)
plugins/mod_pep.lua
prosodyctl

index 896f3e78b764842d04dfaee7c410d806f7c6ad38..46517b9585fc884d2569a34ee9408a21e3f88a45 100644 (file)
@@ -47,11 +47,10 @@ local function subscription_presence(user_bare, recipient)
 end
 
 module:hook("pep-publish-item", function (event)
-       local session, node, id, item = event.session, event.node, event.id, event.item;
+       local session, bare, node, id, item = event.session, event.user, event.node, event.id, event.item;
        item.attr.xmlns = nil;
        local disable = #item.tags ~= 1 or #item.tags[1] == 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'})
                        :tag('items', {node=node})
@@ -183,7 +182,7 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event)
                                payload.attr.id = id;
                                session.send(st.reply(stanza));
                                module:fire_event("pep-publish-item", {
-                                       node = node, actor = session.jid, id = id, session = session, item = st.clone(payload);
+                                       node = node, user = jid_bare(session.full_jid), actor = session.jid, id = id, session = session, item = st.clone(payload);
                                });
                                return true;
                        end
index 4a6ce44efd68acfe4b33fea8250e119cc9eb97cb..15d40f26a7b66e16bb88010b6587be5d6f8b01a9 100755 (executable)
@@ -974,9 +974,10 @@ function commands.check(arg)
                                print("    For more information see https://prosody.im/doc/storage");
                        end
                end
+               local require_encryption = set.intersection(all_options, set.new({"require_encryption", "c2s_require_encryption", "s2s_require_encryption"})):empty();
                local ssl = dependencies.softreq"ssl";
                if not ssl then
-                       if not set.intersection(all_options, set.new({"require_encryption", "c2s_require_encryption", "s2s_require_encryption"})):empty() then
+                       if not require_encryption then
                                print("");
                                print("    You require encryption but LuaSec is not available.");
                                print("    Connections will fail.");
@@ -1006,6 +1007,11 @@ function commands.check(arg)
                                        ok = false;
                                end
                        end
+               elseif require_encryption and not all_modules:contains("tls") then
+                       print("");
+                       print("    You require encryption but mod_tls is not enabled.");
+                       print("    Connections will fail.");
+                       ok = false;
                end
                
                print("Done.\n");