Fix ssb-mentions adding null mentions
See: https://github.com/ssbc/ssb-mentions/issues/14
This commit is contained in:
@ -6,7 +6,9 @@ const meta = require('./models/post')
|
||||
|
||||
module.exports = async function publishReplyAllPage ({ message, text }) {
|
||||
// TODO: rename `message` to `parent` or `ancestor` or similar
|
||||
const mentions = ssbMentions(text) || undefined
|
||||
const mentions = ssbMentions(text).filter((mention) =>
|
||||
mention != null
|
||||
) || undefined
|
||||
const parent = await meta.get(message)
|
||||
|
||||
return post.replyAll({
|
||||
|
@ -5,7 +5,9 @@ const post = require('./models/post')
|
||||
|
||||
module.exports = async function publishReplyPage ({ message, text }) {
|
||||
// TODO: rename `message` to `parent` or `ancestor` or similar
|
||||
const mentions = ssbMentions(text) || undefined
|
||||
const mentions = ssbMentions(text).filter((mention) =>
|
||||
mention != null
|
||||
) || undefined
|
||||
|
||||
const parent = await post.get(message)
|
||||
return post.reply({
|
||||
|
@ -4,7 +4,9 @@ const ssbMentions = require('ssb-mentions')
|
||||
const post = require('./models/post')
|
||||
|
||||
module.exports = async function publishPage ({ text }) {
|
||||
const mentions = ssbMentions(text) || undefined
|
||||
const mentions = ssbMentions(text).filter((mention) =>
|
||||
mention != null
|
||||
) || undefined
|
||||
return post.publish({
|
||||
text,
|
||||
mentions
|
||||
|
Reference in New Issue
Block a user