|
|
@ -15,6 +15,7 @@ import fileType from 'src/services/file_type/file_type.service'
|
|
|
|
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
|
|
|
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
|
|
|
import { mentionMatchesUrl, extractTagFromUrl } from 'src/services/matcher/matcher.service.js'
|
|
|
|
import { mentionMatchesUrl, extractTagFromUrl } from 'src/services/matcher/matcher.service.js'
|
|
|
|
import { filter, find, unescape, uniqBy } from 'lodash'
|
|
|
|
import { filter, find, unescape, uniqBy } from 'lodash'
|
|
|
|
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
|
|
|
|
|
|
const Status = {
|
|
|
|
const Status = {
|
|
|
|
name: 'Status',
|
|
|
|
name: 'Status',
|
|
|
@ -42,20 +43,16 @@ const Status = {
|
|
|
|
showingTall: this.inConversation && this.focused,
|
|
|
|
showingTall: this.inConversation && this.focused,
|
|
|
|
showingLongSubject: false,
|
|
|
|
showingLongSubject: false,
|
|
|
|
error: null,
|
|
|
|
error: null,
|
|
|
|
expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined'
|
|
|
|
expandingSubject: this.$store.getters.mergedConfig.collapseMessageWithSubject,
|
|
|
|
? !this.$store.state.instance.collapseMessageWithSubject
|
|
|
|
|
|
|
|
: !this.$store.state.config.collapseMessageWithSubject,
|
|
|
|
|
|
|
|
betterShadow: this.$store.state.interface.browserSupport.cssFilter
|
|
|
|
betterShadow: this.$store.state.interface.browserSupport.cssFilter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
localCollapseSubjectDefault () {
|
|
|
|
localCollapseSubjectDefault () {
|
|
|
|
return typeof this.$store.state.config.collapseMessageWithSubject === 'undefined'
|
|
|
|
return this.mergedConfig.collapseMessageWithSubject
|
|
|
|
? this.$store.state.instance.collapseMessageWithSubject
|
|
|
|
|
|
|
|
: this.$store.state.config.collapseMessageWithSubject
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
muteWords () {
|
|
|
|
muteWords () {
|
|
|
|
return this.$store.state.config.muteWords
|
|
|
|
return this.mergedConfig.muteWords
|
|
|
|
},
|
|
|
|
},
|
|
|
|
repeaterClass () {
|
|
|
|
repeaterClass () {
|
|
|
|
const user = this.statusoid.user
|
|
|
|
const user = this.statusoid.user
|
|
|
@ -70,18 +67,18 @@ const Status = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
repeaterStyle () {
|
|
|
|
repeaterStyle () {
|
|
|
|
const user = this.statusoid.user
|
|
|
|
const user = this.statusoid.user
|
|
|
|
const highlight = this.$store.state.config.highlight
|
|
|
|
const highlight = this.mergedConfig.highlight
|
|
|
|
return highlightStyle(highlight[user.screen_name])
|
|
|
|
return highlightStyle(highlight[user.screen_name])
|
|
|
|
},
|
|
|
|
},
|
|
|
|
userStyle () {
|
|
|
|
userStyle () {
|
|
|
|
if (this.noHeading) return
|
|
|
|
if (this.noHeading) return
|
|
|
|
const user = this.retweet ? (this.statusoid.retweeted_status.user) : this.statusoid.user
|
|
|
|
const user = this.retweet ? (this.statusoid.retweeted_status.user) : this.statusoid.user
|
|
|
|
const highlight = this.$store.state.config.highlight
|
|
|
|
const highlight = this.mergedConfig.highlight
|
|
|
|
return highlightStyle(highlight[user.screen_name])
|
|
|
|
return highlightStyle(highlight[user.screen_name])
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hideAttachments () {
|
|
|
|
hideAttachments () {
|
|
|
|
return (this.$store.state.config.hideAttachments && !this.inConversation) ||
|
|
|
|
return (this.mergedConfig.hideAttachments && !this.inConversation) ||
|
|
|
|
(this.$store.state.config.hideAttachmentsInConv && this.inConversation)
|
|
|
|
(this.mergedConfig.hideAttachmentsInConv && this.inConversation)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
userProfileLink () {
|
|
|
|
userProfileLink () {
|
|
|
|
return this.generateUserProfileLink(this.status.user.id, this.status.user.screen_name)
|
|
|
|
return this.generateUserProfileLink(this.status.user.id, this.status.user.screen_name)
|
|
|
@ -120,9 +117,7 @@ const Status = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || (!this.inConversation && this.status.thread_muted) || this.muteWordHits.length > 0) },
|
|
|
|
muted () { return !this.unmuted && ((!this.inProfile && this.status.user.muted) || (!this.inConversation && this.status.thread_muted) || this.muteWordHits.length > 0) },
|
|
|
|
hideFilteredStatuses () {
|
|
|
|
hideFilteredStatuses () {
|
|
|
|
return typeof this.$store.state.config.hideFilteredStatuses === 'undefined'
|
|
|
|
return this.mergedConfig.hideFilteredStatuses
|
|
|
|
? this.$store.state.instance.hideFilteredStatuses
|
|
|
|
|
|
|
|
: this.$store.state.config.hideFilteredStatuses
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hideStatus () {
|
|
|
|
hideStatus () {
|
|
|
|
return (this.hideReply || this.deleted) || (this.muted && this.hideFilteredStatuses)
|
|
|
|
return (this.hideReply || this.deleted) || (this.muted && this.hideFilteredStatuses)
|
|
|
@ -163,7 +158,7 @@ const Status = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hideReply () {
|
|
|
|
hideReply () {
|
|
|
|
if (this.$store.state.config.replyVisibility === 'all') {
|
|
|
|
if (this.mergedConfig.replyVisibility === 'all') {
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.inConversation || !this.isReply) {
|
|
|
|
if (this.inConversation || !this.isReply) {
|
|
|
@ -175,7 +170,7 @@ const Status = {
|
|
|
|
if (this.status.type === 'retweet') {
|
|
|
|
if (this.status.type === 'retweet') {
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const checkFollowing = this.$store.state.config.replyVisibility === 'following'
|
|
|
|
const checkFollowing = this.mergedConfig.replyVisibility === 'following'
|
|
|
|
for (var i = 0; i < this.status.attentions.length; ++i) {
|
|
|
|
for (var i = 0; i < this.status.attentions.length; ++i) {
|
|
|
|
if (this.status.user.id === this.status.attentions[i].id) {
|
|
|
|
if (this.status.user.id === this.status.attentions[i].id) {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
@ -220,9 +215,7 @@ const Status = {
|
|
|
|
replySubject () {
|
|
|
|
replySubject () {
|
|
|
|
if (!this.status.summary) return ''
|
|
|
|
if (!this.status.summary) return ''
|
|
|
|
const decodedSummary = unescape(this.status.summary)
|
|
|
|
const decodedSummary = unescape(this.status.summary)
|
|
|
|
const behavior = typeof this.$store.state.config.subjectLineBehavior === 'undefined'
|
|
|
|
const behavior = this.mergedConfig.subjectLineBehavior
|
|
|
|
? this.$store.state.instance.subjectLineBehavior
|
|
|
|
|
|
|
|
: this.$store.state.config.subjectLineBehavior
|
|
|
|
|
|
|
|
const startsWithRe = decodedSummary.match(/^re[: ]/i)
|
|
|
|
const startsWithRe = decodedSummary.match(/^re[: ]/i)
|
|
|
|
if ((behavior !== 'noop' && startsWithRe) || behavior === 'masto') {
|
|
|
|
if ((behavior !== 'noop' && startsWithRe) || behavior === 'masto') {
|
|
|
|
return decodedSummary
|
|
|
|
return decodedSummary
|
|
|
@ -233,8 +226,8 @@ const Status = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attachmentSize () {
|
|
|
|
attachmentSize () {
|
|
|
|
if ((this.$store.state.config.hideAttachments && !this.inConversation) ||
|
|
|
|
if ((this.mergedConfig.hideAttachments && !this.inConversation) ||
|
|
|
|
(this.$store.state.config.hideAttachmentsInConv && this.inConversation) ||
|
|
|
|
(this.mergedConfig.hideAttachmentsInConv && this.inConversation) ||
|
|
|
|
(this.status.attachments.length > this.maxThumbnails)) {
|
|
|
|
(this.status.attachments.length > this.maxThumbnails)) {
|
|
|
|
return 'hide'
|
|
|
|
return 'hide'
|
|
|
|
} else if (this.compact) {
|
|
|
|
} else if (this.compact) {
|
|
|
@ -246,7 +239,7 @@ const Status = {
|
|
|
|
if (this.attachmentSize === 'hide') {
|
|
|
|
if (this.attachmentSize === 'hide') {
|
|
|
|
return []
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return this.$store.state.config.playVideosInModal
|
|
|
|
return this.mergedConfig.playVideosInModal
|
|
|
|
? ['image', 'video']
|
|
|
|
? ['image', 'video']
|
|
|
|
: ['image']
|
|
|
|
: ['image']
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -261,7 +254,7 @@ const Status = {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
maxThumbnails () {
|
|
|
|
maxThumbnails () {
|
|
|
|
return this.$store.state.config.maxThumbnails
|
|
|
|
return this.mergedConfig.maxThumbnails
|
|
|
|
},
|
|
|
|
},
|
|
|
|
contentHtml () {
|
|
|
|
contentHtml () {
|
|
|
|
if (!this.status.summary_html) {
|
|
|
|
if (!this.status.summary_html) {
|
|
|
@ -284,10 +277,9 @@ const Status = {
|
|
|
|
return this.status.tags.filter(tagObj => tagObj.hasOwnProperty('name')).map(tagObj => tagObj.name).join(' ')
|
|
|
|
return this.status.tags.filter(tagObj => tagObj.hasOwnProperty('name')).map(tagObj => tagObj.name).join(' ')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hidePostStats () {
|
|
|
|
hidePostStats () {
|
|
|
|
return typeof this.$store.state.config.hidePostStats === 'undefined'
|
|
|
|
return this.mergedConfig.hidePostStats
|
|
|
|
? this.$store.state.instance.hidePostStats
|
|
|
|
},
|
|
|
|
: this.$store.state.config.hidePostStats
|
|
|
|
...mapGetters(['mergedConfig'])
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
Attachment,
|
|
|
|
Attachment,
|
|
|
|