mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-08 13:29:49 +01:00
Clean up operations
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
e0f2a8cb58
commit
50bd01b1ef
@ -229,8 +229,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
.subscribe(operationsObserver);
|
.subscribe(operationsObserver);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
String finalCredentials = credentials;
|
ncApi.getRoom(credentials, ApiUtils.getRoom(baseUrl, conversationToken))
|
||||||
ncApi.getRoom(finalCredentials, ApiUtils.getRoom(baseUrl, conversationToken))
|
|
||||||
.subscribeOn(Schedulers.newThread())
|
.subscribeOn(Schedulers.newThread())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.retry(1)
|
.retry(1)
|
||||||
@ -243,52 +242,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
@Override
|
@Override
|
||||||
public void onNext(RoomOverall roomOverall) {
|
public void onNext(RoomOverall roomOverall) {
|
||||||
room = roomOverall.getOcs().getData();
|
room = roomOverall.getOcs().getData();
|
||||||
ncApi.getCapabilities(finalCredentials, ApiUtils.getUrlForCapabilities(baseUrl))
|
fetchCapabilities(credentials);
|
||||||
.subscribeOn(Schedulers.newThread())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new Observer<CapabilitiesOverall>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(CapabilitiesOverall capabilitiesOverall) {
|
|
||||||
if (capabilitiesOverall.getOcs().getData()
|
|
||||||
.getCapabilities().getSpreedCapability() != null &&
|
|
||||||
capabilitiesOverall.getOcs().getData()
|
|
||||||
.getCapabilities().getSpreedCapability()
|
|
||||||
.getFeatures() != null && capabilitiesOverall.getOcs().getData()
|
|
||||||
.getCapabilities().getSpreedCapability()
|
|
||||||
.getFeatures().contains("guest-signaling")) {
|
|
||||||
if (room.isHasPassword() && room.isGuest()) {
|
|
||||||
eventBus.post(new BottomSheetLockEvent(true, 0,
|
|
||||||
true, false));
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putParcelable(BundleKeys.KEY_ROOM, Parcels.wrap(room));
|
|
||||||
bundle.putString(BundleKeys.KEY_CALL_URL, callUrl);
|
|
||||||
bundle.putInt(BundleKeys.KEY_OPERATION_CODE, 99);
|
|
||||||
getRouter().pushController(RouterTransaction.with(new EntryMenuController(bundle))
|
|
||||||
.pushChangeHandler(new HorizontalChangeHandler())
|
|
||||||
.popChangeHandler(new HorizontalChangeHandler()));
|
|
||||||
} else {
|
|
||||||
initiateCall();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
showResultImage(false, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
showResultImage(false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -455,6 +409,55 @@ public class OperationsMenuController extends BaseController {
|
|||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void fetchCapabilities(String credentials) {
|
||||||
|
ncApi.getCapabilities(credentials, ApiUtils.getUrlForCapabilities(baseUrl))
|
||||||
|
.subscribeOn(Schedulers.newThread())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<CapabilitiesOverall>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(CapabilitiesOverall capabilitiesOverall) {
|
||||||
|
if (capabilitiesOverall.getOcs().getData()
|
||||||
|
.getCapabilities().getSpreedCapability() != null &&
|
||||||
|
capabilitiesOverall.getOcs().getData()
|
||||||
|
.getCapabilities().getSpreedCapability()
|
||||||
|
.getFeatures() != null && capabilitiesOverall.getOcs().getData()
|
||||||
|
.getCapabilities().getSpreedCapability()
|
||||||
|
.getFeatures().contains("guest-signaling")) {
|
||||||
|
if (room.isHasPassword() && room.isGuest()) {
|
||||||
|
eventBus.post(new BottomSheetLockEvent(true, 0,
|
||||||
|
true, false));
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putParcelable(BundleKeys.KEY_ROOM, Parcels.wrap(room));
|
||||||
|
bundle.putString(BundleKeys.KEY_CALL_URL, callUrl);
|
||||||
|
bundle.putInt(BundleKeys.KEY_OPERATION_CODE, 99);
|
||||||
|
getRouter().pushController(RouterTransaction.with(new EntryMenuController(bundle))
|
||||||
|
.pushChangeHandler(new HorizontalChangeHandler())
|
||||||
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
|
} else {
|
||||||
|
initiateCall();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showResultImage(false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
showResultImage(false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void inviteUsersToAConversation() {
|
private void inviteUsersToAConversation() {
|
||||||
RetrofitBucket retrofitBucket;
|
RetrofitBucket retrofitBucket;
|
||||||
final ArrayList<String> localInvitedUsers = invitedUsers;
|
final ArrayList<String> localInvitedUsers = invitedUsers;
|
||||||
|
Loading…
Reference in New Issue
Block a user