diff --git a/src/user.cpp b/src/user.cpp index 7d9ec3ab793d97f69cb56acbcd386ad433e226ed..3f113f8c82e3183cad6ab67fc2058642cf0b24b3 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -322,6 +322,15 @@ void User::handleDisconnected(const std::string &error, Swift::SpectrumErrorPayl return; } + if (e == Swift::SpectrumErrorPayload::CONNECTION_ERROR_OTHER_ERROR || e == Swift::SpectrumErrorPayload::CONNECTION_ERROR_NETWORK_ERROR) { + LOG4CXX_INFO(logger, m_jid.toString() << ": Disconnecting from legacy network, trying to reconnect automatically."); + // Simulate destruction/resurrection :) + // TODO: If this stops working, create onReconnect signal + m_userManager->onUserDestroyed(this); + m_userManager->onUserCreated(this); + return; + } + if (error.empty()) { LOG4CXX_INFO(logger, m_jid.toString() << ": Disconnected from legacy network"); }