diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp index 3eed56d9723948b7d2584c5dd2625939c291aa7e..c44017502498e7947f72145e38542f6d279115f6 100644 --- a/src/contactmodel.cpp +++ b/src/contactmodel.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (C) 2017-2018 Savoir-faire Linux * + * Copyright (C) 2017-2018 Savoir-faire Linux * * Author: Nicolas Jäger <nicolas.jager@savoirfairelinux.com> * * Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com> * * Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> * diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp index 3562b137b08fd18f24774fccba06b6d309f4c738..db4e4b27d2d2b73aade9c15f86e7c67010cbe716 100644 --- a/src/conversationmodel.cpp +++ b/src/conversationmodel.cpp @@ -1725,6 +1725,12 @@ ConversationModel::sendFile(const std::string& convUid, // Retrieve final peer uri after creation of the conversation const auto& newPeerUri = isTemporary ? pimpl_->conversations.at(contactIndex).participants.front() : peerUri; + auto contactInfo = owner.contactModel->getContact(newPeerUri); + if (contactInfo.isBanned) { + qDebug() << "ContactModel::sendFile: denied, contact is banned"; + return; + } + pimpl_->lrc.getDataTransferModel().sendFile(owner.id.c_str(), newPeerUri.c_str(), path.c_str(),