From b66abca17d07571fc4529c9922be8633ba017131 Mon Sep 17 00:00:00 2001 From: Beaudan Brown Date: Tue, 22 Oct 2019 11:31:20 +1100 Subject: [PATCH] Disable files for friend requests --- background.html | 2 +- js/views/conversation_view.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/background.html b/background.html index d68fbb83a..a2c80e74b 100644 --- a/background.html +++ b/background.html @@ -136,7 +136,7 @@
-
+
diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 8826a89c1..482e15e29 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -93,6 +93,7 @@ initialize(options) { this.listenTo(this.model, 'destroy', this.stopListening); this.listenTo(this.model, 'change:verified', this.onVerifiedChange); + this.listenTo(this.model, 'change:friendRequestStatus', this.updateFileLock); this.listenTo(this.model, 'newmessage', this.addMessage); this.listenTo(this.model, 'opened', this.onOpened); this.listenTo(this.model, 'prune', this.onPrune); @@ -160,6 +161,7 @@ ); this.render(); + this.updateFileLock(); this.model.updateTextInputState(); @@ -621,6 +623,14 @@ } }, + updateFileLock() { + if (this.model.isPrivate() && !this.model.isFriend()) { + this.$('#choose-file').hide() + } else { + this.$('#choose-file').show() + } + }, + toggleMicrophone() { // ALWAYS HIDE until we support audio this.$('.capture-audio').hide();