Skip to content
Snippets Groups Projects
Commit 8070e8b7 authored by Hugo Lefeuvre's avatar Hugo Lefeuvre Committed by Andreas Traczyk
Browse files

conversationmodel: no file transfer with banned contacts


Currently it is not allowed by the lrc to place video calls, audio
calls or send messages to banned contacts, but files can still be
sent. In order to be consistent with previous changes, this patch
forbids file transfer with banned contacts.

Change-Id: I99b7de9a113df3a4925707ba64a5b904626a5662
Reviewed-by: default avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 710f7135
No related branches found
No related tags found
No related merge requests found
...@@ -1725,6 +1725,12 @@ ConversationModel::sendFile(const std::string& convUid, ...@@ -1725,6 +1725,12 @@ ConversationModel::sendFile(const std::string& convUid,
// Retrieve final peer uri after creation of the conversation // Retrieve final peer uri after creation of the conversation
const auto& newPeerUri = isTemporary ? pimpl_->conversations.at(contactIndex).participants.front() : peerUri; 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(), pimpl_->lrc.getDataTransferModel().sendFile(owner.id.c_str(),
newPeerUri.c_str(), newPeerUri.c_str(),
path.c_str(), path.c_str(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment