aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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)