mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Fix issue where call name would not update.
This commit is contained in:
committed by
Greyson Parrelli
parent
dcbf0315c0
commit
40bf7a021a
@@ -518,6 +518,7 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
|
||||
viewModel.getEvents().observe(this, this::handleViewModelEvent);
|
||||
|
||||
lifecycleDisposable.add(viewModel.getInCallstatus().subscribe(this::handleInCallStatus));
|
||||
lifecycleDisposable.add(viewModel.getRecipientFlowable().subscribe(callScreen::setRecipient));
|
||||
|
||||
boolean isStartedFromCallLink = getCallIntent().isStartedFromCallLink();
|
||||
LiveDataUtil.combineLatest(LiveDataReactiveStreams.fromPublisher(viewModel.getCallParticipantsState().toFlowable(BackpressureStrategy.LATEST)),
|
||||
@@ -922,7 +923,6 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
|
||||
previousEvent = event;
|
||||
|
||||
viewModel.setRecipient(event.getRecipient());
|
||||
callScreen.setRecipient(event.getRecipient());
|
||||
controlsAndInfoViewModel.setRecipient(event.getRecipient());
|
||||
|
||||
switch (event.getState()) {
|
||||
|
||||
@@ -622,14 +622,15 @@ public class WebRtcCallView extends InsetAwareConstraintLayout {
|
||||
}
|
||||
|
||||
public void setRecipient(@NonNull Recipient recipient) {
|
||||
collapsedToolbar.setTitle(recipient.getDisplayName(getContext()));
|
||||
recipientName.setText(recipient.getDisplayName(getContext()));
|
||||
|
||||
if (recipient.getId() == recipientId) {
|
||||
return;
|
||||
}
|
||||
|
||||
recipientId = recipient.getId();
|
||||
largeHeaderAvatar.setRecipient(recipient, false);
|
||||
collapsedToolbar.setTitle(recipient.getDisplayName(getContext()));
|
||||
recipientName.setText(recipient.getDisplayName(getContext()));
|
||||
}
|
||||
|
||||
public void setStatus(@Nullable String status) {
|
||||
|
||||
@@ -116,6 +116,10 @@ public class WebRtcCallViewModel extends ViewModel {
|
||||
return liveRecipient.getValue();
|
||||
}
|
||||
|
||||
public Flowable<Recipient> getRecipientFlowable() {
|
||||
return recipientId.switchMap(id -> Recipient.observable(id).toFlowable(BackpressureStrategy.LATEST)).observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public void setRecipient(@NonNull Recipient recipient) {
|
||||
recipientId.onNext(recipient.getId());
|
||||
liveRecipient.setValue(recipient.live());
|
||||
|
||||
Reference in New Issue
Block a user