Revision f3813541 ChatSecure/Classes/Controllers/FileTransferManager.swift

View differences:

ChatSecure/Classes/Controllers/FileTransferManager.swift
523 523
                    downloads = message.existingDownloads(with: transaction)
524 524
                    if let thread = message.threadOwner(with: transaction), let account = OTRAccount.fetchObject(withUniqueID: thread.threadAccountIdentifier, transaction: transaction) {
525 525
                        disableAutomaticURLFetching = account.disableAutomaticURLFetching
526
                        if !disableAutomaticURLFetching, let room = thread as? OTRXMPPRoom, let message = message as? OTRXMPPRoomMessage {
527
                            // For room messages, default to safe mode
528
                            disableAutomaticURLFetching = true
529
                            if let senderJidString = message.senderJID, let senderJID = XMPPJID(string: senderJidString), let roomJID = room.roomJID, let occupant = OTRXMPPRoomOccupant.occupant(jid: senderJID, realJID: senderJID, roomJID: roomJID, accountId: thread.threadAccountIdentifier, createIfNeeded: false, transaction: transaction), occupant.buddy(with: transaction) != nil {
530
                                // We have a buddy, i.e. we are friends with the sender.
531
                                disableAutomaticURLFetching = false
532
                            }
533
                        }
534 526
                    }
535 527
                }
536 528
            }

Also available in: Unified diff