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});
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)) {
ncApi.joinRoom(credentials, ApiUtils.getUrlForParticipantsActive(apiVersion, baseUrl, roomToken),
conversationPassword)
ncApi.joinRoom(credentials, url, conversationPassword)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(3)
@ -1267,6 +1274,8 @@ public class CallController extends BaseController {
@Override
public void onNext(@io.reactivex.annotations.NonNull RoomOverall roomOverall) {
callSession = roomOverall.getOcs().getData().getSessionId();
Log.d(TAG, " new callSession by joinRoom= " + callSession);
ApplicationWideCurrentRoomHolder.getInstance().setSession(callSession);
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomToken);
@ -1276,12 +1285,12 @@ public class CallController extends BaseController {
@Override
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
// unused atm
Log.e(TAG, "joinRoom onError", e);
}
@Override
public void onComplete() {
// unused atm
Log.d(TAG, "joinRoom onComplete");
}
});
} else {
@ -1640,6 +1649,7 @@ public class CallController extends BaseController {
});
}
// TODO: why is this never called?!
private void leaveRoom(boolean shutDownView) {
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());
}
loadAvatar();
// TODO: load avatar, but don't block UI!
// loadAvatar();
checkIfAnyParticipantsRemainInRoom();
showAnswerControls();
}

View File

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