mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 17:08:34 +03:00
Fix call sometimes not working
This commit is contained in:
parent
85769f5d06
commit
61de45464b
3 changed files with 20 additions and 27 deletions
|
@ -260,7 +260,6 @@ public class CallController extends BaseController {
|
|||
conversationUser = userUtils.getCurrentUser();
|
||||
}
|
||||
|
||||
callSession = args.getString(BundleKeys.KEY_CALL_SESSION, "0");
|
||||
credentials = ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken());
|
||||
isVoiceOnlyCall = args.getBoolean(BundleKeys.KEY_CALL_VOICE_ONLY, false);
|
||||
|
||||
|
@ -1025,36 +1024,32 @@ public class CallController extends BaseController {
|
|||
}
|
||||
|
||||
private void joinRoomAndCall() {
|
||||
if ("0".equals(callSession)) {
|
||||
ncApi.joinRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl, roomToken), null)
|
||||
.subscribeOn(Schedulers.newThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.retry(3)
|
||||
.subscribe(new Observer<CallOverall>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
ncApi.joinRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl, roomToken), null)
|
||||
.subscribeOn(Schedulers.newThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.retry(3)
|
||||
.subscribe(new Observer<CallOverall>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CallOverall callOverall) {
|
||||
callSession = callOverall.getOcs().getData().getSessionId();
|
||||
callOrJoinRoomViaWebSocket();
|
||||
}
|
||||
@Override
|
||||
public void onNext(CallOverall callOverall) {
|
||||
callSession = callOverall.getOcs().getData().getSessionId();
|
||||
callOrJoinRoomViaWebSocket();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callOrJoinRoomViaWebSocket();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void callOrJoinRoomViaWebSocket() {
|
||||
|
|
|
@ -1002,7 +1002,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||
bundle.putString(BundleKeys.KEY_ROOM_ID, roomId);
|
||||
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(conversationUser));
|
||||
bundle.putString(BundleKeys.KEY_CONVERSATION_PASSWORD, roomPassword);
|
||||
bundle.putString(BundleKeys.KEY_CALL_SESSION, currentCall.getSessionId());
|
||||
bundle.putString(BundleKeys.KEY_MODIFIED_BASE_URL, baseUrl);
|
||||
|
||||
if (isVoiceOnlyCall) {
|
||||
|
|
|
@ -33,7 +33,6 @@ public class BundleKeys {
|
|||
public static final String KEY_APP_ITEM_PACKAGE_NAME = "KEY_APP_ITEM_PACKAGE_NAME";
|
||||
public static final String KEY_APP_ITEM_NAME = "KEY_APP_ITEM_NAME";
|
||||
public static final String KEY_CONVERSATION_PASSWORD = "KEY_CONVERSATION_PASSWORD";
|
||||
public static final String KEY_CALL_SESSION = "KEY_CONVERSATION_SESSION";
|
||||
public static final String KEY_ROOM_TOKEN = "KEY_ROOM_TOKEN";
|
||||
public static final String KEY_USER_ENTITY = "KEY_USER_ENTITY";
|
||||
public static final String KEY_NEW_CONVERSATION = "KEY_NEW_CONVERSATION";
|
||||
|
|
Loading…
Reference in a new issue