Software /
code /
prosody-modules
Comparison
mod_pubsub_summary/mod_pubsub_summary.lua @ 4437:09657f758f53
mod_pubsub_summary: Skip adding title if already part of summary
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 10 Feb 2021 16:06:30 +0100 |
parent | 4436:07529dba102d |
child | 4438:2bb11055e4bb |
comparison
equal
deleted
inserted
replaced
4436:07529dba102d | 4437:09657f758f53 |
---|---|
29 amp = "&"; | 29 amp = "&"; |
30 nbsp = utf8 and utf8.char(0xa0) or " "; | 30 nbsp = utf8 and utf8.char(0xa0) or " "; |
31 }); | 31 }); |
32 end | 32 end |
33 local summary; | 33 local summary; |
34 if title and content then | 34 if title and content and content:sub(1, #title) ~= title then |
35 summary = title .. "\n\n" .. content; | 35 summary = title .. "\n\n" .. content; |
36 elseif title or content then | 36 elseif title or content then |
37 summary = content or title; | 37 summary = content or title; |
38 end | 38 end |
39 for link in payload:childtags("link") do | 39 for link in payload:childtags("link") do |