mod_pubsub_googlecode/mod_pubsub_googlecode.lua
changeset 951 ef54ae817689
parent 948 79b4a1db7a57
child 1109 d988f2db9773
--- 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