Merge pull request #1722 from Bilb/fix-trust-closed-group

auto download attachment in closed group
This commit is contained in:
Audric Ackermann 2021-06-25 10:59:42 +10:00 committed by GitHub
commit 7192b6ea61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1113,13 +1113,14 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
}
public isTrustedForAttachmentDownload() {
const convoId = this.getSource();
if (!!this.get('isPublic') || isUsFromCache(convoId)) {
const senderConvoId = this.getSource();
const isClosedGroup = this.getConversation()?.isClosedGroup() || false;
if (!!this.get('isPublic') || isClosedGroup || isUsFromCache(senderConvoId)) {
return true;
}
// check the convo from this user
// we want the convo of the sender of this message
const senderConvo = getConversationController().get(convoId);
const senderConvo = getConversationController().get(senderConvoId);
if (!senderConvo) {
return false;
}