diff mod_pubsub_github/mod_pubsub_github.lua @ 3516:d94875c3ddda

mod_pubsub_github: Publish with item id set to commit hash (BC)
author Kim Alvefur <zash@zash.se>
date Sun, 31 Mar 2019 18:08:50 +0200
parents f756e051fa02
children ea1edd7cfb01
line wrap: on
line diff
--- a/mod_pubsub_github/mod_pubsub_github.lua	Sun Mar 31 18:04:11 2019 +0200
+++ b/mod_pubsub_github/mod_pubsub_github.lua	Sun Mar 31 18:08:50 2019 +0200
@@ -38,8 +38,8 @@
 	end -- else .. is this even github?
 
 	for _, commit in ipairs(data.commits) do
-		local ok, err = pubsub_service:publish(node, github_actor, data.repository.name,
-			st.stanza("item", { id = data.repository.name, xmlns = "http://jabber.org/protocol/pubsub" })
+		local ok, err = pubsub_service:publish(node, github_actor, commit.id,
+			st.stanza("item", { id = commit.id, xmlns = "http://jabber.org/protocol/pubsub" })
 			:tag("entry", { xmlns = "http://www.w3.org/2005/Atom" })
 				:tag("id"):text(commit.id):up()
 				:tag("title"):text(commit.message):up()