Comparison

plugins/mod_pubsub/mod_pubsub.lua @ 10070:d7cae7187943

mod_pubsub: Move a comment to where it makes sense This code has moved but the comment did not follow it.
author Kim Alvefur <zash@zash.se>
date Wed, 10 Jul 2019 19:12:19 +0200
parent 9829:fdc42f685557
child 10673:1a23a58ac84e
comparison
equal deleted inserted replaced
10069:6f317e51544d 10070:d7cae7187943
80 if item then 80 if item then
81 message:add_child(item); 81 message:add_child(item);
82 end 82 end
83 83
84 local summary; 84 local summary;
85 -- Compose a sensible textual representation of at least Atom payloads
86 if item and item.tags[1] then 85 if item and item.tags[1] then
87 local payload = item.tags[1]; 86 local payload = item.tags[1];
88 summary = module:fire_event("pubsub-summary/"..payload.attr.xmlns, { 87 summary = module:fire_event("pubsub-summary/"..payload.attr.xmlns, {
89 kind = kind, node = node, jids = jids, actor = actor, item = item, payload = payload, 88 kind = kind, node = node, jids = jids, actor = actor, item = item, payload = payload,
90 }); 89 });
114 113
115 function is_item_stanza(item) 114 function is_item_stanza(item)
116 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; 115 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item";
117 end 116 end
118 117
118 -- Compose a textual representation of Atom payloads
119 module:hook("pubsub-summary/http://www.w3.org/2005/Atom", function (event) 119 module:hook("pubsub-summary/http://www.w3.org/2005/Atom", function (event)
120 local payload = event.payload; 120 local payload = event.payload;
121 local title = payload:get_child_text("title"); 121 local title = payload:get_child_text("title");
122 local summary = payload:get_child_text("summary"); 122 local summary = payload:get_child_text("summary");
123 if not summary and title then 123 if not summary and title then