Use default string from resources if a contact's device has no name, updated TODOs & FIXMEs comments

This commit is contained in:
Sylvain Berfini 2024-03-18 15:14:23 +01:00
parent 57b6c5daa2
commit b3c31d14ad
15 changed files with 31 additions and 28 deletions

View file

@ -131,7 +131,7 @@ class CorePreferences @UiThread constructor(private val context: Context) {
get() = config.getBool("ui", "dark_mode_allowed", true)
@get:WorkerThread
val onlyDisplaySipUriUsername: Boolean // TODO: use it
val onlyDisplaySipUriUsername: Boolean // TODO FIXME: use it
get() = config.getBool("ui", "only_display_sip_uri_username", true)
@get:WorkerThread
@ -144,11 +144,11 @@ class CorePreferences @UiThread constructor(private val context: Context) {
@get:WorkerThread
val disableBroadcasts: Boolean
get() = config.getBool("ui", "disable_broadcast_feature", true) // TODO: not implemented
get() = config.getBool("ui", "disable_broadcast_feature", true) // TODO FIXME: not implemented yet
@get:WorkerThread
val disableCallRecordings: Boolean
get() = config.getBool("ui", "disable_call_recordings_feature", true) // TODO: not implemented
get() = config.getBool("ui", "disable_call_recordings_feature", true) // TODO FIXME: not implemented yet
@get:WorkerThread
val oneAccountMax: Boolean

View file

@ -96,7 +96,7 @@ class TelecomManager @WorkerThread constructor(context: Context) {
coreContext.postOnCoreThread {
if (LinphoneUtils.isCallIncoming(call.state)) {
Log.i("$TAG Answering call")
coreContext.answerCall(call) // TODO: use call type
coreContext.answerCall(call) // TODO FIXME: use call type
}
}
},
@ -108,7 +108,7 @@ class TelecomManager @WorkerThread constructor(context: Context) {
Log.i(
"$TAG Terminating call [${call.remoteAddress.asStringUriOnly()}]"
)
call.terminate() // TODO: use cause
call.terminate() // TODO FIXME: use cause
}
},
{ // onSetActive

View file

@ -546,7 +546,7 @@ class ConferenceModel {
"$TAG Too many participant devices for grid layout, switching to active speaker layout"
)
setNewLayout(ACTIVE_SPEAKER_LAYOUT)
// TODO FIXME: notify user
// TODO: notify user
}
}
}

View file

@ -81,7 +81,7 @@ class StartConversationViewModel @UiThread constructor() : AddressSelectionViewM
Log.e("$TAG Conversation [$id] creation has failed!")
chatRoom.removeListener(this)
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
}
}
}
@ -165,7 +165,7 @@ class StartConversationViewModel @UiThread constructor() : AddressSelectionViewM
} else {
Log.e("$TAG Failed to create group conversation [$groupChatRoomSubject]!")
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
}
}
}
@ -212,7 +212,7 @@ class StartConversationViewModel @UiThread constructor() : AddressSelectionViewM
"$TAG Account is in secure mode, can't chat with SIP address of different domain [${remote.asStringUriOnly()}]"
)
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
return
}
@ -258,7 +258,7 @@ class StartConversationViewModel @UiThread constructor() : AddressSelectionViewM
} else {
Log.e("$TAG Failed to create 1-1 conversation with [${remote.asStringUriOnly()}]!")
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
}
} else {
Log.w(

View file

@ -94,7 +94,7 @@ class ContactNewOrEditViewModel @UiThread constructor() : ViewModel() {
firstName.postValue(vCard.givenName)
lastName.postValue(vCard.familyName)
} else {
// TODO ? What to do when vCard is null
// TODO: What to do if vCard is null?
}
id.postValue(friend.refKey ?: friend.vcard?.uid)
@ -137,7 +137,7 @@ class ContactNewOrEditViewModel @UiThread constructor() : ViewModel() {
val organization = company.value.orEmpty().trim()
if (fn.isEmpty() && ln.isEmpty() && organization.isEmpty()) {
Log.e("$TAG At least a mandatory field wasn't filled, aborting save")
// TODO FIXME: notify user
// TODO: notify user
return
}
@ -224,7 +224,7 @@ class ContactNewOrEditViewModel @UiThread constructor() : ViewModel() {
)
} else {
Log.e("$TAG Failed to generate a ref key using vCard's generateUniqueId()")
// TODO? : generate unique ref key
// TODO: generate unique ref key?
}
friend.isSubscribesEnabled = false
@ -313,7 +313,7 @@ class ContactNewOrEditViewModel @UiThread constructor() : ViewModel() {
@UiThread
fun isPendingChanges(): Boolean {
if (isEdit.value == true) {
// TODO: check if values of each field match friend values
// TODO FIXME: check if values of each field match friend values
return true
}

View file

@ -209,7 +209,7 @@ class ContactViewModel @UiThread constructor() : ViewModel() {
Log.e("$TAG Conversation [$id] creation has failed!")
chatRoom.removeListener(this)
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
}
}
}
@ -603,7 +603,7 @@ class ContactViewModel @UiThread constructor() : ViewModel() {
"$TAG Failed to create 1-1 conversation with [${remote.asStringUriOnly()}]!"
)
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
}
}
}
@ -623,11 +623,12 @@ class ContactViewModel @UiThread constructor() : ViewModel() {
val trusted = device.securityLevel == SecurityLevel.EndToEndEncryptedAndVerified
devicesList.add(
ContactDeviceModel(
device.displayName ?: "???", // TODO: what to do if device name isn't available?
device.displayName ?: AppUtils.getString(
R.string.contact_device_without_name
),
device.address,
trusted
) {
// TODO: check if do not show dialog anymore setting is set
if (::friend.isInitialized) {
startCallToDeviceToIncreaseTrustEvent.value =
Event(Pair(friend.name.orEmpty(), it.address.asStringUriOnly()))

View file

@ -82,7 +82,7 @@ class ContactHistoryViewModel @UiThread constructor() : ViewModel() {
Log.e("$TAG Conversation [$id] creation has failed!")
chatRoom.removeListener(this)
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
}
}
}
@ -254,7 +254,7 @@ class ContactHistoryViewModel @UiThread constructor() : ViewModel() {
"$TAG Failed to create 1-1 conversation with [${remote.asStringUriOnly()}]!"
)
operationInProgress.postValue(false)
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO FIXME: use translated string
chatRoomCreationErrorEvent.postValue(Event("Error!")) // TODO: use translated string
}
}
}

View file

@ -233,7 +233,7 @@ class ScheduleMeetingViewModel @UiThread constructor() : ViewModel() {
subject.postValue(conferenceInfo.subject)
description.postValue(conferenceInfo.description)
isBroadcastSelected.postValue(false) // TODO FIXME
isBroadcastSelected.postValue(false) // TODO FIXME: not implemented yet
startHour = 0
startMinutes = 0
@ -365,7 +365,7 @@ class ScheduleMeetingViewModel @UiThread constructor() : ViewModel() {
}
}
// TODO FIXME handle speakers when in broadcast mode
// TODO FIXME: handle speakers when in broadcast mode
@UiThread
fun schedule() {

View file

@ -57,7 +57,7 @@ class CardDavAddressBookConfigurationFragment : GenericFragment() {
viewModel.cardDavOperationSuccessfulEvent.observe(viewLifecycleOwner) {
it.consume {
Log.i("$TAG CardDAV friend list operation was successful, going back")
// TODO FIXME: show green toast
// TODO: show green toast
goBack()
}
}

View file

@ -110,7 +110,7 @@ class AccountProfileViewModel @UiThread constructor() : ViewModel() {
showModeSelection.postValue(showMode)
val devicesList = arrayListOf<AccountDeviceModel>()
// TODO FIXME: use real devices list from API
// TODO FIXME: use real devices list from API, not implemented yet
devices.postValue(devicesList)
val prefix = account.params.internationalPrefix

View file

@ -147,7 +147,7 @@ class CardDavViewModel : ViewModel() {
val name = displayName.value.orEmpty().trim()
val server = serverUrl.value.orEmpty().trim()
if (name.isEmpty() || server.isEmpty()) {
// TODO FIXME: improve toast
// TODO: improve toast
showErrorToastEvent.postValue(Event(Pair(R.drawable.x, "Name or Server is empty!")))
return
}
@ -157,7 +157,7 @@ class CardDavViewModel : ViewModel() {
val authRealm = realm.value.orEmpty().trim()
coreContext.postOnCoreThread { core ->
// TODO FIXME: add dialog to ask user before removing existing friend list & auth info ?
// TODO: add dialog to ask user before removing existing friend list & auth info ?
if (isEdit.value == false) {
val foundFriendList = core.getFriendListByName(name)
if (foundFriendList != null) {

View file

@ -169,7 +169,7 @@ class LdapViewModel : ViewModel() {
ldapServerOperationSuccessfulEvent.postValue(Event(true))
} catch (e: Exception) {
Log.e("$TAG Exception while creating LDAP: $e")
// TODO FIXME: improve toast
// TODO: improve toast
showErrorToastEvent.postValue(
Event(Pair(R.drawable.x, e.toString()))
)

View file

@ -230,7 +230,7 @@ class MainViewModel @UiThread constructor() : ViewModel() {
removeAlert(NON_DEFAULT_ACCOUNT_NOTIFICATIONS)
// TODO: compute other calls notifications count
// TODO FIXME: compute other accounts notifications count
}
@WorkerThread

View file

@ -357,6 +357,7 @@
<string name="contact_message_action">Message</string>
<string name="contact_video_call_action">Appel vidéo</string>
<string name="contact_make_call_check_device_trust">Vérifier</string>
<string name="contact_device_without_name">Appareil sans nom</string>
<string name="conversations_list_empty">Aucune conversation pour le moment…</string>
<string name="conversations_list_is_being_removed_label">En cours de suppression…</string>

View file

@ -404,6 +404,7 @@
<string name="contact_message_action">Message</string>
<string name="contact_video_call_action">Video Call</string>
<string name="contact_make_call_check_device_trust">Verify</string>
<string name="contact_device_without_name">Unnamed device</string>
<!-- Chat -->
<string name="conversations_list_empty">No conversation for the moment…</string>