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
/****************************************************************************
* 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> *
......
......@@ -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(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment