Software /
code /
prosody-modules
Changeset
951:ef54ae817689
mod_pubsub_googlecode: Split name and email when possible
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 03 Apr 2013 18:49:27 +0100 |
parents | 950:bea0ef13575c |
children | 952:ef2253a7858d |
files | mod_pubsub_googlecode/mod_pubsub_googlecode.lua |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_pubsub_googlecode/mod_pubsub_googlecode.lua Wed Apr 03 19:42:04 2013 +0200 +++ b/mod_pubsub_googlecode/mod_pubsub_googlecode.lua Wed Apr 03 18:49:27 2013 +0100 @@ -49,6 +49,12 @@ end rev.message = "wiki ("..(what or "unknown page").."): "..rev.message; end + + local name = rev.author; + local email = name:match("<([^>]+)>$"); + if email then + name = name:gsub("%s*<[^>]+>$", ""); + end local ok, err = pubsub_service:publish(node, true, project, st.stanza("item", { xmlns = "http://jabber.org/protocol/pubsub", id = project }) @@ -58,7 +64,8 @@ :tag("link", { rel = "alternate", href = rev.url }):up() :tag("published"):text(datetime(rev.timestamp)):up() :tag("author") - :tag("name"):text(rev.author):up() + :tag("name"):text(name):up() + :tag("email"):text(email):up() :up() ); end