mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 21:45:42 +03:00
Fix a few bugs
This commit is contained in:
parent
8af64364b7
commit
91d0d829e0
5 changed files with 13 additions and 8 deletions
|
@ -365,10 +365,12 @@ public class AccountVerificationController extends BaseController {
|
|||
fetchAndStoreExternalSignalingSettings();
|
||||
}
|
||||
} else if (eventStatus.getEventType().equals(EventStatus.EventType.SIGNALING_SETTINGS)) {
|
||||
if (eventStatus.isAllGood()) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(() -> progressText.setText(progressText.getText().toString() + "\n" +
|
||||
getResources().getString(R.string.nc_external_server_failed)));
|
||||
}
|
||||
}
|
||||
|
||||
proceedWithLogin();
|
||||
}
|
||||
|
|
|
@ -1194,7 +1194,7 @@ public class CallController extends BaseController {
|
|||
private void setupAndInitiateWebSocketsConnection() {
|
||||
webSocketConnectionHelper = new WebSocketConnectionHelper();
|
||||
webSocketClient = webSocketConnectionHelper.getExternalSignalingInstanceForServer(
|
||||
externalSignalingServer.getExternalSignalingServer(), false,
|
||||
externalSignalingServer.getExternalSignalingServer(),
|
||||
conversationUser, externalSignalingServer.getExternalSignalingTicket());
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class WebsocketConnectionsWorker extends Worker {
|
|||
if (!TextUtils.isEmpty(externalSignalingServer.getExternalSignalingServer()) &&
|
||||
!TextUtils.isEmpty(externalSignalingServer.getExternalSignalingTicket())) {
|
||||
webSocketConnectionHelper.getExternalSignalingInstanceForServer(
|
||||
externalSignalingServer.getExternalSignalingServer(), false,
|
||||
externalSignalingServer.getExternalSignalingServer(),
|
||||
userEntity, externalSignalingServer.getExternalSignalingTicket());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -77,7 +77,6 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
|||
Request request = new Request.Builder().url(connectionUrl).build();
|
||||
|
||||
this.webSocket = okHttpClient.newWebSocket(request, this);
|
||||
|
||||
this.conversationUser = conversationUser;
|
||||
this.webSocketTicket = webSocketTicket;
|
||||
this.webSocketConnectionHelper = new WebSocketConnectionHelper();
|
||||
|
@ -231,4 +230,8 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
|||
Log.e(TAG, "Failed to offer request");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return connected;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,11 +69,11 @@ public class WebSocketConnectionHelper {
|
|||
return generatedURL;
|
||||
}
|
||||
|
||||
public MagicWebSocketInstance getExternalSignalingInstanceForServer(String url, boolean forceReconnect, UserEntity userEntity, String webSocketTicket) {
|
||||
public synchronized MagicWebSocketInstance getExternalSignalingInstanceForServer(String url, UserEntity userEntity, String webSocketTicket) {
|
||||
|
||||
String connectionUrl = getExternalSignalingServerUrlFromSettingsUrl(url);
|
||||
|
||||
if (magicWebSocketInstanceMap.containsKey(userEntity.getUserId()) && !forceReconnect) {
|
||||
if (magicWebSocketInstanceMap.containsKey(userEntity.getUserId())) {
|
||||
return magicWebSocketInstanceMap.get(userEntity.getUserId());
|
||||
} else {
|
||||
MagicWebSocketInstance magicWebSocketInstance = new MagicWebSocketInstance(userEntity, connectionUrl, webSocketTicket);
|
||||
|
|
Loading…
Reference in a new issue