aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-08-29 12:12:27 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-08-29 12:12:27 -0700
commit63b9d0c20fa2a26e783a138c9e5b98b4cfca3230 (patch)
treee5957c681337fd7667a910dc0a9c9bacc22037ec
parent4be893165b9747520a03c43fa0c92bd9f823ebbb (diff)
downloadpatchfoo-63b9d0c20fa2a26e783a138c9e5b98b4cfca3230.tar.gz
patchfoo-63b9d0c20fa2a26e783a138c9e5b98b4cfca3230.zip
Include content warning in post title
-rw-r--r--lib/render-msg.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index b8e0123..82395af 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -485,10 +485,13 @@ RenderMsg.prototype.title1 = function (cb) {
if (!self.c || typeof self.c !== 'object') {
cb(null, self.msg.key)
} else if (typeof self.c.text === 'string') {
+ var text = typeof self.c.contentWarning === 'string' ?
+ '[CW: ' + self.c.contentWarning + ']\n\n' + self.c.text :
+ self.c.text
if (self.c.type === 'post')
- cb(null, title(self.c.text) || '…')
+ cb(null, title(text) || '…')
else
- cb(null, '%' + self.c.type + ': ' + (self.c.title || title(self.c.text)))
+ cb(null, '%' + self.c.type + ': ' + (self.c.title || title(text)))
} else {
if (self.c.type === 'ssb-dns')
cb(null, self.c.record && JSON.stringify(self.c.record.data) || self.msg.key)