diff --git a/src/App.js b/src/App.js index a052e058..39c97a80 100644 --- a/src/App.js +++ b/src/App.js @@ -29,7 +29,7 @@ export default { style () { return { 'background-image': `url(${this.background})` } }, sitename () { return this.$store.state.config.name }, chat () { return this.$store.state.chat.channel.state === 'joined' }, - showWhoToFollowPanel () { return this.$store.state.config.showWhoToFollowPanel }, + suggestionsEnabled () { return this.$store.state.config.suggestionsEnabled }, showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel } }, methods: { diff --git a/src/App.scss b/src/App.scss index ae6561a9..3b8b3224 100644 --- a/src/App.scss +++ b/src/App.scss @@ -63,8 +63,6 @@ button{ box-shadow: 0px 0px 2px black; font-size: 14px; font-family: sans-serif; - min-width: 10em; - min-height: 2em; &:hover { box-shadow: 0px 0px 4px rgba(255, 255, 255, 0.3); diff --git a/src/App.vue b/src/App.vue index 923d411b..71e90289 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,7 +24,7 @@ - + diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue index d2bdffcb..b7fed48a 100644 --- a/src/components/login_form/login_form.vue +++ b/src/components/login_form/login_form.vue @@ -34,6 +34,11 @@ @import '../../_variables.scss'; .login-form { + .btn { + min-height: 28px; + width: 10em; + } + .error { text-align: center; } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 1e1c6f1d..2b84758b 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -107,6 +107,10 @@ padding: 0.5em; height: 32px; + button { + width: 10em; + } + p { margin: 0.35em; padding: 0.35em; diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index c85ef59f..d5ca33cc 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -8,6 +8,7 @@ const settings = { hideAttachmentsLocal: this.$store.state.config.hideAttachments, hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw, + replyVisibilityLocal: this.$store.state.config.replyVisibility, loopVideoLocal: this.$store.state.config.loopVideo, loopVideoSilentOnlyLocal: this.$store.state.config.loopVideoSilentOnly, muteWordsString: this.$store.state.config.muteWords.join('\n'), @@ -44,6 +45,9 @@ const settings = { hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, + replyVisibilityLocal (value) { + this.$store.dispatch('setOption', { name: 'replyVisibility', value }) + }, loopVideoLocal (value) { this.$store.dispatch('setOption', { name: 'loopVideo', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 170f5773..9612876e 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -38,6 +38,16 @@ +
  • + +
  • @@ -117,6 +127,8 @@ .btn { margin-top: 1em; + min-height: 28px; + width: 10em; } } .setting-list { diff --git a/src/components/status/status.js b/src/components/status/status.js index 9670f69d..11b8feba 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -83,7 +83,6 @@ const Status = { return hits }, muted () { return !this.unmuted && (this.status.user.muted || this.muteWordHits.length > 0) }, - isReply () { return !!this.status.in_reply_to_status_id }, isFocused () { // retweet or root of an expanded conversation if (this.focused) { @@ -105,6 +104,48 @@ const Status = { const lengthScore = this.status.statusnet_html.split(/ 20 }, + isReply () { + if (this.status.in_reply_to_status_id) { + return true + } + // For private replies where we can't see the OP, in_reply_to_status_id will be null. + // So instead, check that the post starts with a @mention. + if (this.status.visibility === 'private') { + var textBody = this.status.text + if (this.status.summary !== null) { + textBody = textBody.substring(this.status.summary.length, textBody.length) + } + return textBody.startsWith('@') + } + return false + }, + hideReply () { + if (this.$store.state.config.replyVisibility === 'all') { + return false + } + if (this.inlineExpanded || this.expanded || this.inConversation || !this.isReply) { + return false + } + if (this.status.user.id === this.$store.state.users.currentUser.id) { + return false + } + if (this.status.activity_type === 'repeat') { + return false + } + var checkFollowing = this.$store.state.config.replyVisibility === 'following' + for (var i = 0; i < this.status.attentions.length; ++i) { + if (this.status.user.id === this.status.attentions[i].id) { + continue + } + if (checkFollowing && this.status.attentions[i].following) { + return false + } + if (this.status.attentions[i].id === this.$store.state.users.currentUser.id) { + return false + } + } + return this.status.attentions.length > 0 + }, hideSubjectStatus () { if (this.tallStatus && !this.$store.state.config.collapseMessageWithSubject) { return false diff --git a/src/components/status/status.vue b/src/components/status/status.vue index e7d5ed7a..2bc44ee7 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -1,5 +1,5 @@