mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-05 22:05:11 +00:00
Finally some reconnection magic working
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
87ea461f53
commit
ceac6efa39
@ -38,8 +38,8 @@ android {
|
||||
targetSdkVersion 28
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
versionCode 101
|
||||
versionName "6.0.7beta"
|
||||
versionCode 102
|
||||
versionName "6.1.0"
|
||||
|
||||
flavorDimensions "default"
|
||||
renderscriptTargetApi 19
|
||||
|
@ -1190,6 +1190,10 @@ public class CallController extends BaseController {
|
||||
externalSignalingServer.getExternalSignalingServer(),
|
||||
conversationUser, externalSignalingServer.getExternalSignalingTicket(),
|
||||
TextUtils.isEmpty(credentials));
|
||||
} else {
|
||||
if (webSocketClient.isConnected() && currentCallStatus.equals(CallStatus.PUBLISHER_FAILED)) {
|
||||
webSocketClient.restartWebSocket();
|
||||
}
|
||||
}
|
||||
|
||||
joinRoomAndCall();
|
||||
@ -1707,6 +1711,7 @@ public class CallController extends BaseController {
|
||||
peerConnectionEvent.getChangeValue());
|
||||
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent.PeerConnectionEventType.PUBLISHER_FAILED)) {
|
||||
currentCallStatus = CallStatus.PUBLISHER_FAILED;
|
||||
webSocketClient.clearResumeId();
|
||||
if (MerlinTheWizard.isConnectedToInternet()) {
|
||||
hangup(false);
|
||||
}
|
||||
|
@ -1157,6 +1157,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.BACKGROUND)
|
||||
public void onMessageEvent(UserMentionClickEvent userMentionClickEvent) {
|
||||
if ((!currentConversation.getType().equals(Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) || !currentConversation.getName().equals(userMentionClickEvent.getUserId()))) {
|
||||
|
@ -123,9 +123,16 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
||||
connected = false;
|
||||
messagesQueue = new ArrayList<>();
|
||||
}
|
||||
|
||||
restartWebSocket();
|
||||
}
|
||||
|
||||
private void restartWebSocket() {
|
||||
|
||||
public void clearResumeId() {
|
||||
resumeId = "";
|
||||
}
|
||||
|
||||
public void restartWebSocket() {
|
||||
reconnecting = true;
|
||||
|
||||
if (MerlinTheWizard.isConnectedToInternet()) {
|
||||
@ -282,7 +289,6 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
||||
@Override
|
||||
public void onClosing(WebSocket webSocket, int code, String reason) {
|
||||
Log.d(TAG, "Closing : " + code + " / " + reason);
|
||||
Log.d("MARIO", String.valueOf(webSocket.hashCode()));
|
||||
LoggingUtils.writeLogEntryToFile(context,
|
||||
"WebSocket " + webSocket.hashCode() + " Closing: " + reason);
|
||||
}
|
||||
@ -369,7 +375,7 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isConnected() {
|
||||
public boolean isConnected() {
|
||||
return connected;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
Loading…
Reference in New Issue
Block a user