Changeset

3275:25b4cad8fee4

mod_atom: Include User Nickname (if configured to be public)
author Kim Alvefur <zash@zash.se>
date Fri, 24 Aug 2018 22:52:13 +0200
parents 3274:2acfb45fd9ec
children 3276:cb4b26221cf6
files mod_atom/mod_atom.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_atom/mod_atom.lua	Fri Aug 24 23:00:08 2018 +0200
+++ b/mod_atom/mod_atom.lua	Fri Aug 24 22:52:13 2018 +0200
@@ -26,6 +26,10 @@
 					:tag("author")
 						:text_tag("name", user)
 						:text_tag("preferredUsername", user, { xmlns = "http://portablecontacts.net/spec/1.0" });
+				local ok, _, nick = pubsub_service:get_last_item("http://jabber.org/protocol/nick", actor);
+				if ok and nick then
+					feed:text_tag("displayName", nick.tags[1][1], { xmlns = "http://portablecontacts.net/spec/1.0" });
+				end
 
 				feed:reset();