mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
ConversationModule: require conversation to accept request
Change-Id: I8b4ce0139272158d77d7cb91d929e8b5f3bea035
This commit is contained in:
@ -17,11 +17,6 @@
|
||||
|
||||
#include "conversation_module.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
#include <opendht/thread_pool.h>
|
||||
|
||||
#include "account_const.h"
|
||||
#include "call.h"
|
||||
#include "client/ring_signal.h"
|
||||
@ -33,6 +28,12 @@
|
||||
#include "vcard.h"
|
||||
#include "json_utils.h"
|
||||
|
||||
#include <opendht/thread_pool.h>
|
||||
#include <dhtnet/certstore.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
namespace jami {
|
||||
|
||||
using ConvInfoMap = std::map<std::string, ConvInfo>;
|
||||
@ -2845,17 +2846,21 @@ ConversationModule::conversationVCard(const std::string& conversationId) const
|
||||
bool
|
||||
ConversationModule::isBanned(const std::string& convId, const std::string& uri) const
|
||||
{
|
||||
dhtnet::tls::TrustStore::PermissionStatus status;
|
||||
{
|
||||
std::lock_guard lk(pimpl_->conversationsMtx_);
|
||||
status = pimpl_->accountManager_->getCertificateStatus(uri);
|
||||
}
|
||||
if (auto conv = pimpl_->getConversation(convId)) {
|
||||
std::lock_guard lk(conv->mtx);
|
||||
if (!conv->conversation)
|
||||
return true;
|
||||
if (conv->conversation->mode() != ConversationMode::ONE_TO_ONE)
|
||||
return conv->conversation->isBanned(uri);
|
||||
// If 1:1 we check the certificate status
|
||||
return status == dhtnet::tls::TrustStore::PermissionStatus::BANNED;
|
||||
}
|
||||
// If 1:1 we check the certificate status
|
||||
std::lock_guard lk(pimpl_->conversationsMtx_);
|
||||
return pimpl_->accountManager_->getCertificateStatus(uri)
|
||||
== dhtnet::tls::TrustStore::PermissionStatus::BANNED;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user