diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index 64cca1956f2518f69e57469ad035be499a15dd89..56727a670317e9de4664baf2d77885fdfa6579fe 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -2013,10 +2013,14 @@ JamiAccount::doRegister_() std::unique_lock lk(shared->connManagerMtx_); shared->initConnectionManager(); lk.unlock(); - shared->requestSIPConnection( - shared->getUsername(), - crt->getLongId(), - "sync"); // For git notifications, will use the same socket as sync + shared->requestMessageConnection(shared->getUsername(), crt->getLongId(), "sync"); + if (!shared->syncModule()->isConnected(crt->getLongId())) { + shared->channelHandlers_[Uri::Scheme::SYNC] + ->connect(crt->getLongId(), + "", + [](std::shared_ptr<dhtnet::ChannelSocket> socket, + const DeviceId& deviceId) {}); + } }); } }, @@ -2338,8 +2342,7 @@ JamiAccount::convModule(bool noCreation) cb(nullptr); return; } - - shared->requestSIPConnection(uri, deviceId, ""); + shared->requestMessageConnection(uri, deviceId, ""); } cb(socket); }); @@ -3253,10 +3256,10 @@ JamiAccount::sendMessage(const std::string& to, } // Else, ask for a channel to send the message - requestSIPConnection(to, deviceId, payload_type); + requestMessageConnection(to, deviceId, payload_type); }); } else { - requestSIPConnection(to, device, payload_type); + requestMessageConnection(to, device, payload_type); } } @@ -3758,7 +3761,6 @@ JamiAccount::requestSIPConnection(const std::string& peerId, bool forceNewConnection, const std::shared_ptr<SIPCall>& pc) { - requestMessageConnection(peerId, deviceId, connectionType); if (peerId == getUsername()) { if (!syncModule()->isConnected(deviceId)) channelHandlers_[Uri::Scheme::SYNC]