|
|
@ -156,7 +156,8 @@ const PostStatusForm = {
|
|
|
|
poll: this.statusPoll || {},
|
|
|
|
poll: this.statusPoll || {},
|
|
|
|
mediaDescriptions: this.statusMediaDescriptions || {},
|
|
|
|
mediaDescriptions: this.statusMediaDescriptions || {},
|
|
|
|
visibility: this.statusScope || scope,
|
|
|
|
visibility: this.statusScope || scope,
|
|
|
|
contentType: statusContentType
|
|
|
|
contentType: statusContentType,
|
|
|
|
|
|
|
|
quoting: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -265,6 +266,24 @@ const PostStatusForm = {
|
|
|
|
isEdit () {
|
|
|
|
isEdit () {
|
|
|
|
return typeof this.statusId !== 'undefined' && this.statusId.trim() !== ''
|
|
|
|
return typeof this.statusId !== 'undefined' && this.statusId.trim() !== ''
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
quotable () {
|
|
|
|
|
|
|
|
if (!this.replyTo) {
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const repliedStatus = this.$store.state.statuses.allStatusesObject[this.replyTo]
|
|
|
|
|
|
|
|
if (!repliedStatus) {
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (repliedStatus.visibility === 'public' ||
|
|
|
|
|
|
|
|
repliedStatus.visibility === 'unlisted' ||
|
|
|
|
|
|
|
|
repliedStatus.visibility === 'local') {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
} else if (repliedStatus.visibility === 'private') {
|
|
|
|
|
|
|
|
return repliedStatus.account.id === this.$store.state.users.currentUser.id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
...mapGetters(['mergedConfig']),
|
|
|
|
...mapGetters(['mergedConfig']),
|
|
|
|
...mapState({
|
|
|
|
...mapState({
|
|
|
|
mobileLayout: state => state.interface.mobileLayout
|
|
|
|
mobileLayout: state => state.interface.mobileLayout
|
|
|
@ -292,7 +311,8 @@ const PostStatusForm = {
|
|
|
|
visibility: newStatus.visibility,
|
|
|
|
visibility: newStatus.visibility,
|
|
|
|
contentType: newStatus.contentType,
|
|
|
|
contentType: newStatus.contentType,
|
|
|
|
poll: {},
|
|
|
|
poll: {},
|
|
|
|
mediaDescriptions: {}
|
|
|
|
mediaDescriptions: {},
|
|
|
|
|
|
|
|
quoting: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.pollFormVisible = false
|
|
|
|
this.pollFormVisible = false
|
|
|
|
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
|
|
|
|
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
|
|
|
@ -340,6 +360,8 @@ const PostStatusForm = {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const replyOrQuoteAttr = newStatus.quoting ? 'quoteId' : 'inReplyToStatusId'
|
|
|
|
|
|
|
|
|
|
|
|
const postingOptions = {
|
|
|
|
const postingOptions = {
|
|
|
|
status: newStatus.status,
|
|
|
|
status: newStatus.status,
|
|
|
|
spoilerText: newStatus.spoilerText || null,
|
|
|
|
spoilerText: newStatus.spoilerText || null,
|
|
|
@ -347,7 +369,7 @@ const PostStatusForm = {
|
|
|
|
sensitive: newStatus.nsfw,
|
|
|
|
sensitive: newStatus.nsfw,
|
|
|
|
media: newStatus.files,
|
|
|
|
media: newStatus.files,
|
|
|
|
store: this.$store,
|
|
|
|
store: this.$store,
|
|
|
|
inReplyToStatusId: this.replyTo,
|
|
|
|
[replyOrQuoteAttr]: this.replyTo,
|
|
|
|
contentType: newStatus.contentType,
|
|
|
|
contentType: newStatus.contentType,
|
|
|
|
poll,
|
|
|
|
poll,
|
|
|
|
idempotencyKey: this.idempotencyKey
|
|
|
|
idempotencyKey: this.idempotencyKey
|
|
|
@ -373,6 +395,7 @@ const PostStatusForm = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const newStatus = this.newStatus
|
|
|
|
const newStatus = this.newStatus
|
|
|
|
this.previewLoading = true
|
|
|
|
this.previewLoading = true
|
|
|
|
|
|
|
|
const replyOrQuoteAttr = newStatus.quoting ? 'quoteId' : 'inReplyToStatusId'
|
|
|
|
statusPoster.postStatus({
|
|
|
|
statusPoster.postStatus({
|
|
|
|
status: newStatus.status,
|
|
|
|
status: newStatus.status,
|
|
|
|
spoilerText: newStatus.spoilerText || null,
|
|
|
|
spoilerText: newStatus.spoilerText || null,
|
|
|
@ -380,7 +403,7 @@ const PostStatusForm = {
|
|
|
|
sensitive: newStatus.nsfw,
|
|
|
|
sensitive: newStatus.nsfw,
|
|
|
|
media: [],
|
|
|
|
media: [],
|
|
|
|
store: this.$store,
|
|
|
|
store: this.$store,
|
|
|
|
inReplyToStatusId: this.replyTo,
|
|
|
|
[replyOrQuoteAttr]: this.replyTo,
|
|
|
|
contentType: newStatus.contentType,
|
|
|
|
contentType: newStatus.contentType,
|
|
|
|
poll: {},
|
|
|
|
poll: {},
|
|
|
|
preview: true
|
|
|
|
preview: true
|
|
|
|