add logging and comments

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-10-26 14:58:37 +02:00
parent 2c1b45491d
commit e0e3bf4c32
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
3 changed files with 22 additions and 5 deletions

View File

@ -1252,9 +1252,16 @@ public class CallController extends BaseController {
int apiVersion = ApiUtils.getConversationApiVersion(conversationUser, new int[] {ApiUtils.APIv4, 1}); int apiVersion = ApiUtils.getConversationApiVersion(conversationUser, new int[] {ApiUtils.APIv4, 1});
Log.d(TAG, "joinRoomAndCall");
Log.d(TAG, " baseUrl= " + baseUrl);
Log.d(TAG, " roomToken= " + roomToken);
Log.d(TAG, " callSession= " + callSession);
String url = ApiUtils.getUrlForParticipantsActive(apiVersion, baseUrl, roomToken);
Log.d(TAG, " url= " + url);
if (TextUtils.isEmpty(callSession)) { if (TextUtils.isEmpty(callSession)) {
ncApi.joinRoom(credentials, ApiUtils.getUrlForParticipantsActive(apiVersion, baseUrl, roomToken), ncApi.joinRoom(credentials, url, conversationPassword)
conversationPassword)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.retry(3) .retry(3)
@ -1267,6 +1274,8 @@ public class CallController extends BaseController {
@Override @Override
public void onNext(@io.reactivex.annotations.NonNull RoomOverall roomOverall) { public void onNext(@io.reactivex.annotations.NonNull RoomOverall roomOverall) {
callSession = roomOverall.getOcs().getData().getSessionId(); callSession = roomOverall.getOcs().getData().getSessionId();
Log.d(TAG, " new callSession by joinRoom= " + callSession);
ApplicationWideCurrentRoomHolder.getInstance().setSession(callSession); ApplicationWideCurrentRoomHolder.getInstance().setSession(callSession);
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId); ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomToken); ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomToken);
@ -1276,12 +1285,12 @@ public class CallController extends BaseController {
@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, "joinRoom onError", e);
} }
@Override @Override
public void onComplete() { public void onComplete() {
// unused atm Log.d(TAG, "joinRoom onComplete");
} }
}); });
} else { } else {
@ -1640,6 +1649,7 @@ public class CallController extends BaseController {
}); });
} }
// TODO: why is this never called?!
private void leaveRoom(boolean shutDownView) { private void leaveRoom(boolean shutDownView) {
int apiVersion = ApiUtils.getConversationApiVersion(conversationUser, new int[] {ApiUtils.APIv4, 1}); int apiVersion = ApiUtils.getConversationApiVersion(conversationUser, new int[] {ApiUtils.APIv4, 1});

View File

@ -315,7 +315,8 @@ public class CallNotificationController extends BaseController {
conversationNameTextView.setText(currentConversation.getDisplayName()); conversationNameTextView.setText(currentConversation.getDisplayName());
} }
loadAvatar(); // TODO: load avatar, but don't block UI!
// loadAvatar();
checkIfAnyParticipantsRemainInRoom(); checkIfAnyParticipantsRemainInRoom();
showAnswerControls(); showAnswerControls();
} }

View File

@ -269,6 +269,8 @@ class ChatController(args: Bundle) :
this.roomToken = args.getString(KEY_ROOM_TOKEN, "") this.roomToken = args.getString(KEY_ROOM_TOKEN, "")
this.sharedText = args.getString(BundleKeys.KEY_SHARED_TEXT, "") this.sharedText = args.getString(BundleKeys.KEY_SHARED_TEXT, "")
Log.d(TAG, "roomToken = " + roomToken)
if (args.containsKey(KEY_ACTIVE_CONVERSATION)) { if (args.containsKey(KEY_ACTIVE_CONVERSATION)) {
this.currentConversation = Parcels.unwrap<Conversation>(args.getParcelable(KEY_ACTIVE_CONVERSATION)) this.currentConversation = Parcels.unwrap<Conversation>(args.getParcelable(KEY_ACTIVE_CONVERSATION))
} }
@ -289,6 +291,7 @@ class ChatController(args: Bundle) :
} }
private fun getRoomInfo() { private fun getRoomInfo() {
Log.d(TAG, "getRoomInfo")
val shouldRepeat = CapabilitiesUtil.hasSpreedFeatureCapability(conversationUser, "webinary-lobby") val shouldRepeat = CapabilitiesUtil.hasSpreedFeatureCapability(conversationUser, "webinary-lobby")
if (shouldRepeat) { if (shouldRepeat) {
checkingLobbyStatus = true checkingLobbyStatus = true
@ -308,6 +311,8 @@ class ChatController(args: Bundle) :
@Suppress("Detekt.TooGenericExceptionCaught") @Suppress("Detekt.TooGenericExceptionCaught")
override fun onNext(roomOverall: RoomOverall) { override fun onNext(roomOverall: RoomOverall) {
currentConversation = roomOverall.ocs.data currentConversation = roomOverall.ocs.data
Log.d(TAG, "currentConversation.toString : " + currentConversation.toString())
Log.d(TAG, "currentConversation.sessionId : " + currentConversation?.sessionId)
loadAvatarForStatusBar() loadAvatarForStatusBar()
setTitle() setTitle()
@ -419,6 +424,7 @@ class ChatController(args: Bundle) :
override fun onViewBound(view: View) { override fun onViewBound(view: View) {
actionBar?.show() actionBar?.show()
Log.d(TAG, "onViewBound")
var adapterWasNull = false var adapterWasNull = false
if (adapter == null) { if (adapter == null) {