mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01: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() {
|
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 avatarSize =
|
||||||
(int) DisplayUtils.convertDpToPixel(conversationVoiceCallMenuItem.getIcon().getIntrinsicWidth(), getActivity());
|
(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());
|
bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_ID(), roomOverall.getOcs().getData().getRoomId());
|
||||||
|
|
||||||
if (currentUser.hasSpreedFeatureCapability("chat-v2")) {
|
if (currentUser.hasSpreedFeatureCapability("chat-v2")) {
|
||||||
|
ncApi.getRoom(credentials,
|
||||||
|
ApiUtils.getRoom(currentUser.getBaseUrl(),
|
||||||
|
roomOverall.getOcs().getData().getToken()))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<RoomOverall>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(RoomOverall roomOverall) {
|
||||||
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(),
|
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(),
|
||||||
Parcels.wrap(roomOverall.getOcs().getData()));
|
Parcels.wrap(roomOverall.getOcs().getData()));
|
||||||
|
|
||||||
ConductorRemapping.INSTANCE.remapChatController(getRouter(), currentUser.getId(),
|
ConductorRemapping.INSTANCE.remapChatController(getRouter(), currentUser.getId(),
|
||||||
roomOverall.getOcs().getData().getToken(), bundle, true);
|
roomOverall.getOcs().getData().getToken(), bundle, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
conversationIntent.putExtras(bundle);
|
conversationIntent.putExtras(bundle);
|
||||||
startActivity(conversationIntent);
|
startActivity(conversationIntent);
|
||||||
|
@ -293,6 +293,20 @@ public class OperationsMenuController extends BaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(RoomOverall roomOverall) {
|
||||||
|
conversation = roomOverall.getOcs().getData();
|
||||||
|
|
||||||
|
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
|
@Override
|
||||||
public void onNext(RoomOverall roomOverall) {
|
public void onNext(RoomOverall roomOverall) {
|
||||||
conversation = roomOverall.getOcs().getData();
|
conversation = roomOverall.getOcs().getData();
|
||||||
@ -309,6 +323,20 @@ public class OperationsMenuController extends BaseController {
|
|||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
showResultImage(false, false);
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
dispose();
|
dispose();
|
||||||
|
Loading…
Reference in New Issue
Block a user