diff --git a/src/jamidht/conversation_module.cpp b/src/jamidht/conversation_module.cpp index 53fcb874879e1b92a75d24f57f99ca1cb2b39216..22da9796bd78cefd629e12582780f456b661f90d 100644 --- a/src/jamidht/conversation_module.cpp +++ b/src/jamidht/conversation_module.cpp @@ -582,13 +582,18 @@ ConversationModule::Impl::fetchNewCommits(const std::string& peer, auto conv = getConversation(conversationId); if (!conv) { - JAMI_WARNING("[Account {}] Unable to find conversation {}, ask for an invite", - accountId_, - conversationId); - sendMsgCb_(peer, - {}, - std::map<std::string, std::string> {{MIME_TYPE_INVITE, conversationId}}, - 0); + if (oldReq == std::nullopt) { + // We didn't find a conversation or a request with the given ID. + // This suggests that someone tried to send us an invitation but + // that we didn't receive it, so we ask for a new one. + JAMI_WARNING("[Account {}] Unable to find conversation {}, ask for an invite", + accountId_, + conversationId); + sendMsgCb_(peer, + {}, + std::map<std::string, std::string> {{MIME_TYPE_INVITE, conversationId}}, + 0); + } return; } std::unique_lock lk(conv->mtx);