diff --git a/src/libsync/pushnotifications.cpp b/src/libsync/pushnotifications.cpp index fcae8e985b..8febf024dd 100644 --- a/src/libsync/pushnotifications.cpp +++ b/src/libsync/pushnotifications.cpp @@ -76,6 +76,9 @@ void PushNotifications::closeWebSocket() _reconnectTimer->stop(); } + disconnect(_webSocket, QOverload::of(&QWebSocket::error), this, &PushNotifications::onWebSocketError); + disconnect(_webSocket, &QWebSocket::sslErrors, this, &PushNotifications::onWebSocketSslErrors); + _webSocket->close(); } @@ -171,6 +174,8 @@ void PushNotifications::openWebSocket() const auto webSocketUrl = capabilities.pushNotificationsWebSocketUrl(); qCInfo(lcPushNotifications) << "Open connection to websocket on" << webSocketUrl << "for account" << _account->url(); + connect(_webSocket, QOverload::of(&QWebSocket::error), this, &PushNotifications::onWebSocketError); + connect(_webSocket, &QWebSocket::sslErrors, this, &PushNotifications::onWebSocketSslErrors); _webSocket->open(webSocketUrl); }