mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
Add logging for websockets
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
8f0b21ab21
commit
8f3a3570e9
@ -1989,7 +1989,7 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
|
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
|
||||||
// unused atm
|
Log.e(TAG, "Error while leaving the call", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2216,7 +2216,7 @@ class ChatActivity :
|
|||||||
Log.d(TAG, "not leaving room (validSessionId is false)")
|
Log.d(TAG, "not leaving room (validSessionId is false)")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "not leaving room...")
|
Log.d(TAG, "not leaving room...")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) {
|
if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) {
|
||||||
|
@ -23,6 +23,7 @@ package com.nextcloud.talk.jobs;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.data.user.model.User;
|
import com.nextcloud.talk.data.user.model.User;
|
||||||
@ -41,6 +42,8 @@ import autodagger.AutoInjector;
|
|||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class WebsocketConnectionsWorker extends Worker {
|
public class WebsocketConnectionsWorker extends Worker {
|
||||||
|
|
||||||
|
public static final String TAG = "WebsocketConnectionsWorker";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
UserManager userManager;
|
UserManager userManager;
|
||||||
|
|
||||||
@ -52,6 +55,8 @@ public class WebsocketConnectionsWorker extends Worker {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Result doWork() {
|
public Result doWork() {
|
||||||
|
Log.d(TAG, "WebsocketConnectionsWorker started ");
|
||||||
|
|
||||||
NextcloudTalkApplication.Companion.getSharedApplication().getComponentApplication().inject(this);
|
NextcloudTalkApplication.Companion.getSharedApplication().getComponentApplication().inject(this);
|
||||||
|
|
||||||
List<User> users = userManager.getUsers().blockingGet();
|
List<User> users = userManager.getUsers().blockingGet();
|
||||||
@ -61,9 +66,14 @@ public class WebsocketConnectionsWorker extends Worker {
|
|||||||
user.getExternalSignalingServer().getExternalSignalingServer() != null &&
|
user.getExternalSignalingServer().getExternalSignalingServer() != null &&
|
||||||
!TextUtils.isEmpty(user.getExternalSignalingServer().getExternalSignalingServer()) &&
|
!TextUtils.isEmpty(user.getExternalSignalingServer().getExternalSignalingServer()) &&
|
||||||
!TextUtils.isEmpty(user.getExternalSignalingServer().getExternalSignalingTicket())) {
|
!TextUtils.isEmpty(user.getExternalSignalingServer().getExternalSignalingTicket())) {
|
||||||
|
|
||||||
|
Log.d(TAG,
|
||||||
|
"WebsocketConnectionsWorker - getExternalSignalingInstanceForServer for user " + user.getDisplayName());
|
||||||
|
|
||||||
webSocketConnectionHelper.getExternalSignalingInstanceForServer(
|
webSocketConnectionHelper.getExternalSignalingInstanceForServer(
|
||||||
user.getExternalSignalingServer().getExternalSignalingServer(),
|
user.getExternalSignalingServer().getExternalSignalingServer(),
|
||||||
user, user.getExternalSignalingServer().getExternalSignalingTicket(),
|
user,
|
||||||
|
user.getExternalSignalingServer().getExternalSignalingTicket(),
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,13 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.utils.singletons;
|
package com.nextcloud.talk.utils.singletons;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.nextcloud.talk.data.user.model.User;
|
import com.nextcloud.talk.data.user.model.User;
|
||||||
|
|
||||||
public class ApplicationWideCurrentRoomHolder {
|
public class ApplicationWideCurrentRoomHolder {
|
||||||
|
|
||||||
|
public static final String TAG = "ApplicationWideCurrentRoomHolder";
|
||||||
private static final ApplicationWideCurrentRoomHolder holder = new ApplicationWideCurrentRoomHolder();
|
private static final ApplicationWideCurrentRoomHolder holder = new ApplicationWideCurrentRoomHolder();
|
||||||
private String currentRoomId = "";
|
private String currentRoomId = "";
|
||||||
private String currentRoomToken = "";
|
private String currentRoomToken = "";
|
||||||
@ -36,6 +40,7 @@ public class ApplicationWideCurrentRoomHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
|
Log.d(TAG, "ApplicationWideCurrentRoomHolder was cleared");
|
||||||
currentRoomId = "";
|
currentRoomId = "";
|
||||||
userInRoom = new User();
|
userInRoom = new User();
|
||||||
inCall = false;
|
inCall = false;
|
||||||
|
@ -84,12 +84,14 @@ public class WebSocketConnectionHelper {
|
|||||||
|
|
||||||
WebSocketInstance webSocketInstance;
|
WebSocketInstance webSocketInstance;
|
||||||
if (userId != -1 && webSocketInstanceMap.containsKey(user.getId()) && (webSocketInstance = webSocketInstanceMap.get(user.getId())) != null) {
|
if (userId != -1 && webSocketInstanceMap.containsKey(user.getId()) && (webSocketInstance = webSocketInstanceMap.get(user.getId())) != null) {
|
||||||
|
Log.d(TAG, "webSocketInstanceMap already contained webSocketInstance for userId " + user.getId());
|
||||||
return webSocketInstance;
|
return webSocketInstance;
|
||||||
} else {
|
} else {
|
||||||
if (userId == -1) {
|
if (userId == -1) {
|
||||||
deleteExternalSignalingInstanceForUserEntity(userId);
|
deleteExternalSignalingInstanceForUserEntity(userId);
|
||||||
}
|
}
|
||||||
webSocketInstance = new WebSocketInstance(user, generatedURL, webSocketTicket);
|
webSocketInstance = new WebSocketInstance(user, generatedURL, webSocketTicket);
|
||||||
|
Log.d(TAG, "created new webSocketInstance for userId " + user.getId());
|
||||||
webSocketInstanceMap.put(user.getId(), webSocketInstance);
|
webSocketInstanceMap.put(user.getId(), webSocketInstance);
|
||||||
return webSocketInstance;
|
return webSocketInstance;
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,7 @@ class WebSocketInstance internal constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onOpen(webSocket: WebSocket, response: Response) {
|
override fun onOpen(webSocket: WebSocket, response: Response) {
|
||||||
|
Log.d(TAG, "Open webSocket")
|
||||||
internalWebSocket = webSocket
|
internalWebSocket = webSocket
|
||||||
sendHello()
|
sendHello()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user