Skip to content
Snippets Groups Projects
Commit feb232f0 authored by Adrien Béraud's avatar Adrien Béraud Committed by Adrien Béraud
Browse files

ConversationChannelHandler: add log to know why a channel is refused

Change-Id: I2655eb16f9a6e6cbee6bdb8ae620ec3102cf0c94
parent d577a1ae
No related branches found
No related tags found
No related merge requests found
......@@ -52,12 +52,22 @@ ConversationChannelHandler::onRequest(const std::shared_ptr<dht::crypto::Certifi
auto sep = name.find_last_of('/');
auto conversationId = name.substr(sep + 1);
if (auto acc = account_.lock())
if (auto acc = account_.lock()) {
if (auto convModule = acc->convModule(true)) {
auto res = !convModule->isBanned(conversationId, cert->issuer->getId().toString());
res &= !convModule->isBanned(conversationId, cert->getLongId().toString());
if (!res) {
JAMI_WARNING("Received ConversationChannel request for '{}' but user {} is banned", name, cert->issuer->getId().toString());
} else {
res &= !convModule->isBanned(conversationId, cert->getLongId().toString());
if (!res) {
JAMI_WARNING("Received ConversationChannel request for '{}' but device {} is banned", name, cert->getLongId().toString());
}
}
return res;
} else {
JAMI_ERROR("Received ConversationChannel request but conversation module is unavailable");
}
}
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment