mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 06:15:12 +00:00
Fix conversation creation process
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
4e76a5e83e
commit
ccb554e1f5
@ -358,7 +358,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
}
|
||||
|
||||
private void loadAvatarForStatusBar() {
|
||||
if (currentConversation != null && currentConversation.getType().equals(Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) && getActivity() != null && conversationVoiceCallMenuItem != null) {
|
||||
if (currentConversation != null && currentConversation.getType() != null && currentConversation.getType().equals(Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) && getActivity() != null && conversationVoiceCallMenuItem != null) {
|
||||
int avatarSize =
|
||||
(int) DisplayUtils.convertDpToPixel(conversationVoiceCallMenuItem.getIcon().getIntrinsicWidth(), getActivity());
|
||||
|
||||
|
@ -264,11 +264,37 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_ID(), roomOverall.getOcs().getData().getRoomId());
|
||||
|
||||
if (currentUser.hasSpreedFeatureCapability("chat-v2")) {
|
||||
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(),
|
||||
Parcels.wrap(roomOverall.getOcs().getData()));
|
||||
ncApi.getRoom(credentials,
|
||||
ApiUtils.getRoom(currentUser.getBaseUrl(),
|
||||
roomOverall.getOcs().getData().getToken()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<RoomOverall>() {
|
||||
|
||||
ConductorRemapping.INSTANCE.remapChatController(getRouter(), currentUser.getId(),
|
||||
roomOverall.getOcs().getData().getToken(), bundle, true);
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(RoomOverall roomOverall) {
|
||||
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(),
|
||||
Parcels.wrap(roomOverall.getOcs().getData()));
|
||||
|
||||
ConductorRemapping.INSTANCE.remapChatController(getRouter(), currentUser.getId(),
|
||||
roomOverall.getOcs().getData().getToken(), bundle, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
conversationIntent.putExtras(bundle);
|
||||
startActivity(conversationIntent);
|
||||
|
@ -296,11 +296,39 @@ public class OperationsMenuController extends BaseController {
|
||||
@Override
|
||||
public void onNext(RoomOverall roomOverall) {
|
||||
conversation = roomOverall.getOcs().getData();
|
||||
if (conversationType.equals(Conversation.ConversationType.ROOM_PUBLIC_CALL) && isGroupCallWorkaroundFinal) {
|
||||
performGroupCallWorkaround(credentials);
|
||||
} else {
|
||||
inviteUsersToAConversation();
|
||||
}
|
||||
|
||||
ncApi.getRoom(credentials,
|
||||
ApiUtils.getRoom(currentUser.getBaseUrl(), conversation.getToken()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<RoomOverall>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(RoomOverall roomOverall) {
|
||||
conversation = roomOverall.getOcs().getData();
|
||||
if (conversationType.equals(Conversation.ConversationType.ROOM_PUBLIC_CALL) && isGroupCallWorkaroundFinal) {
|
||||
performGroupCallWorkaround(credentials);
|
||||
} else {
|
||||
inviteUsersToAConversation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
showResultImage(false, false);
|
||||
dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user