comparison mod_pubsub_github/mod_pubsub_github.lua @ 3519:ac623080324a

mod_pubsub_github: Only put first line of commit message in title, rest in content
author Kim Alvefur <zash@zash.se>
date Sun, 31 Mar 2019 18:16:49 +0200
parents 95c1c3e057cf
children 37e89a76c7d7
comparison
equal deleted inserted replaced
3518:95c1c3e057cf 3519:ac623080324a
47 for _, commit in ipairs(data.commits) do 47 for _, commit in ipairs(data.commits) do
48 local ok, err = pubsub_service:publish(node, github_actor, commit.id, 48 local ok, err = pubsub_service:publish(node, github_actor, commit.id,
49 st.stanza("item", { id = commit.id, xmlns = "http://jabber.org/protocol/pubsub" }) 49 st.stanza("item", { id = commit.id, xmlns = "http://jabber.org/protocol/pubsub" })
50 :tag("entry", { xmlns = "http://www.w3.org/2005/Atom" }) 50 :tag("entry", { xmlns = "http://www.w3.org/2005/Atom" })
51 :tag("id"):text(commit.id):up() 51 :tag("id"):text(commit.id):up()
52 :tag("title"):text(commit.message):up() 52 :tag("title"):text(commit.message:match("^[^\r\n]*")):up()
53 :tag("content"):text(commit.message):up()
53 :tag("link", { rel = "alternate", href = commit.url }):up() 54 :tag("link", { rel = "alternate", href = commit.url }):up()
54 :tag("published"):text(commit.author.date):up() 55 :tag("published"):text(commit.author.date):up()
55 :tag("author") 56 :tag("author")
56 :tag("name"):text(commit.author.name):up() 57 :tag("name"):text(commit.author.name):up()
57 :tag("email"):text(commit.author.email):up() 58 :tag("email"):text(commit.author.email):up()