Remove display name part of call transfer related toasts

This commit is contained in:
Sylvain Berfini 2024-01-15 11:00:08 +01:00
parent 4b2058fbe6
commit 82f1e1b486
4 changed files with 15 additions and 27 deletions

View file

@ -178,12 +178,8 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
"$TAG Transferred call [${transfered.remoteAddress.asStringUriOnly()}] state changed [$state]"
)
if (state == Call.State.Connected) {
// TODO FIXME: Remote is call being transferred, not transferee !
val displayName = contactsManager.findDisplayName(transfered.remoteAddress)
val message = context.getString(
org.linphone.R.string.toast_call_transfer_successful,
displayName
org.linphone.R.string.toast_call_transfer_successful
)
val icon = org.linphone.R.drawable.phone_transfer

View file

@ -178,18 +178,18 @@ class CallActivity : GenericActivity() {
}
callViewModel.transferInProgressEvent.observe(this) {
it.consume { remote ->
it.consume {
showGreenToast(
getString(R.string.toast_call_transfer_in_progress, remote),
getString(R.string.toast_call_transfer_in_progress),
R.drawable.phone_transfer
)
}
}
callViewModel.transferFailedEvent.observe(this) {
it.consume { remote ->
it.consume {
showRedToast(
getString(R.string.toast_call_transfer_failed, remote),
getString(R.string.toast_call_transfer_failed),
R.drawable.warning_circle
)
}

View file

@ -160,12 +160,12 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
MutableLiveData<Event<Boolean>>()
}
val transferInProgressEvent: MutableLiveData<Event<String>> by lazy {
MutableLiveData<Event<String>>()
val transferInProgressEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
val transferFailedEvent: MutableLiveData<Event<String>> by lazy {
MutableLiveData<Event<String>>()
val transferFailedEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
val numpadModel: NumpadModel
@ -344,17 +344,10 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
"$TAG Transferred call [${transfered.remoteAddress.asStringUriOnly()}] state changed [$state]"
)
// TODO FIXME: Remote is call being transferred, not transferee !
if (state == Call.State.OutgoingProgress) {
val displayName = coreContext.contactsManager.findDisplayName(
transfered.remoteAddress
)
transferInProgressEvent.postValue(Event(displayName))
transferInProgressEvent.postValue(Event(true))
} else if (LinphoneUtils.isCallEnding(state)) {
val displayName = coreContext.contactsManager.findDisplayName(
transfered.remoteAddress
)
transferFailedEvent.postValue(Event(displayName))
transferFailedEvent.postValue(Event(true))
}
}
}
@ -721,8 +714,7 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
Log.i("$TAG Blind call transfer is successful")
} else {
Log.e("$TAG Failed to make blind call transfer!")
val displayName = coreContext.contactsManager.findDisplayName(to)
transferFailedEvent.postValue(Event(displayName))
transferFailedEvent.postValue(Event(true))
}
}
}

View file

@ -165,9 +165,9 @@
<string name="toast_text_waiting_to_be_shared">Text is waiting to be shared</string>
<string name="toast_message_waiting_to_be_forwarded">A message is waiting to be forwarded</string>
<string name="toast_end_to_end_encrypted_conversation">Conversation is end-to-end encrypted</string>
<string name="toast_call_transfer_in_progress">Call is being transferred to %s</string>
<string name="toast_call_transfer_successful">Call has been transferred to %s</string>
<string name="toast_call_transfer_failed">Call transfer to %s failed!</string>
<string name="toast_call_transfer_in_progress">Call is being transferred</string>
<string name="toast_call_transfer_successful">Call has been successfully transferred</string>
<string name="toast_call_transfer_failed">Call transfer failed!</string>
<string name="assistant_account_login">Login</string>
<string name="assistant_scan_qr_code">Scan QR code</string>