Comparison

plugins/mod_pubsub/mod_pubsub.lua @ 9234:d00e8ec7ece2

mod_pubsub: Fix summary generation for Atom entries to use the correct field
author Kim Alvefur <zash@zash.se>
date Fri, 31 Aug 2018 21:57:04 +0200
parent 9188:ef2616ade453
child 9597:17d43543f9b6
comparison
equal deleted inserted replaced
9233:885dd6845e62 9234:d00e8ec7ece2
112 function is_item_stanza(item) 112 function is_item_stanza(item)
113 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; 113 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item";
114 end 114 end
115 115
116 module:hook("pubsub-summary/http://www.w3.org/2005/Atom", function (event) 116 module:hook("pubsub-summary/http://www.w3.org/2005/Atom", function (event)
117 local payload = event.item; 117 local payload = event.payload;
118 local title = payload:get_child_text("title"); 118 local title = payload:get_child_text("title");
119 local summary = payload:get_child_text("summary"); 119 local summary = payload:get_child_text("summary");
120 if not summary and title then 120 if not summary and title then
121 local author = payload:find("author/name#"); 121 local author = payload:find("author/name#");
122 summary = title; 122 summary = title;