diff options
| author | Henry Jameson <me@hjkos.com> | 2021-06-22 20:16:26 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-06-22 20:16:26 +0300 |
| commit | a258182522e85c31fe9dfbfbddf7a314ca36d0ca (patch) | |
| tree | dd30275e114325700ae8b068e015d5b4c0cde437 /src/components/rich_content | |
| parent | c6831a381033fa160fba95fa88b1179d3c670d9d (diff) | |
fix non-notifying mentions and original mention display
Diffstat (limited to 'src/components/rich_content')
| -rw-r--r-- | src/components/rich_content/rich_content.jsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 79acd1de..cd73f2e5 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -36,6 +36,10 @@ export default Vue.component('RichContent', { required: true, type: String }, + attentions: { + required: false, + default: () => [] + }, // Emoji object, as in status.emojis, note the "s" at the end... emoji: { required: true, @@ -91,8 +95,12 @@ export default Vue.component('RichContent', { </a> } - const renderMention = (attrs, children, encounteredText) => { + const renderMention = (attrs, children) => { const linkData = getLinkData(attrs, children, mentionIndex++) + linkData.notifying = this.attentions.some(a => a.statusnet_profile_url === linkData.url) + if (!linkData.notifying) { + encounteredText = true + } writtenMentions.push(linkData) if (!encounteredText) { firstMentions.push(linkData) @@ -148,7 +156,7 @@ export default Vue.component('RichContent', { const Tag = getTagName(opener) const attrs = getAttrs(opener) switch (Tag) { - case 'span': // replace images with StillImage + case 'span': // Replace last mentions class with mentionsline if (attrs['class'] && attrs['class'].includes('lastMentions')) { if (firstMentions.length > 1 && lastMentions.length > 1) { break |
