From d50440d8024a36a8b0d6ab6f44ff8e0aeaedf9c8 Mon Sep 17 00:00:00 2001
From: scarlett <nia@netbsd.org>
Date: Sat, 25 Aug 2018 20:33:44 +0100
Subject: When a post with a subject is collapsed, hide its attachments.

---
 src/components/status/status.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/components/status/status.vue')

diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 2bc44ee7..e8951220 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -83,7 +83,7 @@
             <a v-if="showingMore" href="#" class="status-unhider" @click.prevent="toggleShowMore">Show less</a>
           </div>
 
-          <div v-if='status.attachments' class='attachments media-body'>
+          <div v-if='status.attachments && !hideSubjectStatus' class='attachments media-body'>
             <attachment :size="attachmentSize" :status-id="status.id" :nsfw="status.nsfw" :attachment="attachment" v-for="attachment in status.attachments" :key="attachment.id">
             </attachment>
           </div>
-- 
cgit v1.2.3-70-g09d2


From 52ce86ed573deede5e762f4096ef02ee87b04e88 Mon Sep 17 00:00:00 2001
From: scarlett <nia@netbsd.org>
Date: Sun, 26 Aug 2018 00:21:54 +0100
Subject: Don't use nsfw clickthrough if the post is collapsed by default.

---
 src/components/status/status.js  | 9 +++++++++
 src/components/status/status.vue | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

(limited to 'src/components/status/status.vue')

diff --git a/src/components/status/status.js b/src/components/status/status.js
index 11b8feba..7aa1e03b 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -164,6 +164,15 @@ const Status = {
     showingMore () {
       return this.showingTall || (this.status.summary && this.expandingSubject)
     },
+    nsfwClickthrough () {
+      if (!this.status.nsfw) {
+        return false
+      }
+      if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) {
+        return false
+      }
+      return true
+    },
     attachmentSize () {
       if ((this.$store.state.config.hideAttachments && !this.inConversation) ||
         (this.$store.state.config.hideAttachmentsInConv && this.inConversation)) {
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index e8951220..c7ef92a2 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -84,7 +84,7 @@
           </div>
 
           <div v-if='status.attachments && !hideSubjectStatus' class='attachments media-body'>
-            <attachment :size="attachmentSize" :status-id="status.id" :nsfw="status.nsfw" :attachment="attachment" v-for="attachment in status.attachments" :key="attachment.id">
+            <attachment :size="attachmentSize" :status-id="status.id" :nsfw="nsfwClickthrough" :attachment="attachment" v-for="attachment in status.attachments" :key="attachment.id">
             </attachment>
           </div>
 
-- 
cgit v1.2.3-70-g09d2

