# HG changeset patch # User Kim Alvefur # Date 1554051776 -7200 # Node ID bcfd6e5bb0f5876d517291471b05e62356695cfb # Parent 8c1a3b989990fcc1d7984ce5cde159087469abdc mod_pubsub_github: Reorder code to prepare for more code reordering diff -r 8c1a3b989990 -r bcfd6e5bb0f5 mod_pubsub_github/mod_pubsub_github.lua --- a/mod_pubsub_github/mod_pubsub_github.lua Sun Mar 31 18:31:57 2019 +0200 +++ b/mod_pubsub_github/mod_pubsub_github.lua Sun Mar 31 19:02:56 2019 +0200 @@ -53,6 +53,11 @@ return "Invalid JSON. From you of all people..."; end + local node = default_node; + if node_mapping then + node = node_prefix .. data.repository[node_mapping]; + end + local github_event = request.headers.x_github_event if github_event == "push" then module:log("debug", "Handling 'push' event: \n%s\n", tostring(request.body)); @@ -61,11 +66,6 @@ return 501; end -- else .. is this even github? - local node = default_node; - if node_mapping then - node = node_prefix .. data.repository[node_mapping]; - end - for _, commit in ipairs(data.commits) do local ok, err = pubsub_service:publish(node, github_actor, commit.id, st.stanza("item", { id = commit.id, xmlns = "http://jabber.org/protocol/pubsub" })