mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Changes related to TODO comments
This commit is contained in:
parent
86d9e25f17
commit
61365ff3c2
25 changed files with 96 additions and 54 deletions
|
|
@ -83,14 +83,6 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
showCallActivity()
|
||||
}
|
||||
}
|
||||
Call.State.UpdatedByRemote -> {
|
||||
// TODO FIXME: remove
|
||||
val params = core.createCallParams(call)
|
||||
params?.isVideoEnabled = true
|
||||
core.isVideoCaptureEnabled = true
|
||||
core.isVideoDisplayEnabled = true
|
||||
call.acceptUpdate(params)
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,8 +124,6 @@ class LoginFragment : Fragment() {
|
|||
|
||||
viewModel.accountLoginErrorEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { message ->
|
||||
Log.e("$TAG Failed to log in account [$message]")
|
||||
// TODO FIXME: don't use message from callback
|
||||
(requireActivity() as AssistantActivity).showRedToast(
|
||||
message,
|
||||
R.drawable.warning_circle
|
||||
|
|
|
|||
|
|
@ -110,8 +110,6 @@ class ThirdPartySipAccountLoginFragment : Fragment() {
|
|||
|
||||
viewModel.accountLoginErrorEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { message ->
|
||||
Log.e("$TAG Failed to log in account [$message]")
|
||||
// TODO FIXME: don't use message from callback
|
||||
(requireActivity() as AssistantActivity).showRedToast(
|
||||
message,
|
||||
R.drawable.warning_circle
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import org.linphone.core.CoreListenerStub
|
|||
import org.linphone.core.DialPlan
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.ui.assistant.fragment.CountryPickerFragment
|
||||
import org.linphone.utils.AppUtils
|
||||
import org.linphone.utils.Event
|
||||
|
||||
class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPickerFragment.CountryPickedListener {
|
||||
|
|
@ -98,8 +99,11 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
|
|||
AccountCreator.Status.AccountExist, AccountCreator.Status.AccountExistWithAlias -> {
|
||||
operationInProgress.postValue(false)
|
||||
createEnabled.postValue(false)
|
||||
// TODO FIXME: use translated string
|
||||
usernameError.postValue("Account already exists")
|
||||
|
||||
val error = AppUtils.getString(
|
||||
R.string.assistant_account_register_username_already_in_use_error
|
||||
)
|
||||
usernameError.postValue(error)
|
||||
}
|
||||
AccountCreator.Status.AccountNotExist -> {
|
||||
operationInProgress.postValue(false)
|
||||
|
|
@ -126,8 +130,11 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
|
|||
AccountCreator.Status.AliasExist, AccountCreator.Status.AliasIsAccount -> {
|
||||
operationInProgress.postValue(false)
|
||||
createEnabled.postValue(false)
|
||||
// TODO FIXME: use translated string
|
||||
phoneNumberError.postValue("Phone number already used")
|
||||
|
||||
val error = AppUtils.getString(
|
||||
R.string.assistant_account_register_phone_number_already_in_use_error
|
||||
)
|
||||
phoneNumberError.postValue(error)
|
||||
}
|
||||
AccountCreator.Status.AliasNotExist -> {
|
||||
operationInProgress.postValue(false)
|
||||
|
|
@ -305,19 +312,20 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
|
|||
"$TAG Failed to compute phone number using international prefix [$digitsPrefix] and number [$number]"
|
||||
)
|
||||
operationInProgress.postValue(false)
|
||||
// TODO FIXME: use translated string
|
||||
phoneNumberError.postValue(
|
||||
"Wrong international prefix / local phone number"
|
||||
|
||||
val error = AppUtils.getString(
|
||||
R.string.assistant_account_register_invalid_phone_number_error
|
||||
)
|
||||
phoneNumberError.postValue(error)
|
||||
}
|
||||
} else {
|
||||
Log.e(
|
||||
"$TAG Failed to set phone number [$number] and prefix [$digitsPrefix] into account creator!"
|
||||
)
|
||||
// TODO FIXME: use translated string
|
||||
phoneNumberError.postValue(
|
||||
"Failed to configure phone number and prefix in account creator!"
|
||||
val error = AppUtils.getString(
|
||||
R.string.assistant_account_register_invalid_phone_number_error
|
||||
)
|
||||
phoneNumberError.postValue(error)
|
||||
}
|
||||
} else {
|
||||
Log.e("$TAG Account creator hasn't been initialized!")
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class AccountLoginViewModel @UiThread constructor() : ViewModel() {
|
|||
// TODO: show translated string
|
||||
accountLoginErrorEvent.postValue(Event(message))
|
||||
|
||||
Log.e("$TAG Account failed to REGISTER, removing it")
|
||||
Log.e("$TAG Account failed to REGISTER [$message], removing it")
|
||||
core.removeAuthInfo(newlyCreatedAuthInfo)
|
||||
core.removeAccount(newlyCreatedAccount)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ThirdPartySipAccountLoginViewModel @UiThread constructor() : ViewModel() {
|
|||
// TODO: show translated string
|
||||
accountLoginErrorEvent.postValue(Event(message))
|
||||
|
||||
Log.e("$TAG Account failed to REGISTER, removing it")
|
||||
Log.e("$TAG Account failed to REGISTER [$message], removing it")
|
||||
core.removeAuthInfo(newlyCreatedAuthInfo)
|
||||
core.removeAccount(newlyCreatedAccount)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,6 @@ class CallLogViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
@UiThread
|
||||
fun sendMessage() {
|
||||
// TODO
|
||||
// TODO: chat feature
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class CallsListViewModel @UiThread constructor() : AbstractTopBarViewModel() {
|
|||
private fun computeCallLogsList(filter: String) {
|
||||
val list = arrayListOf<CallLogModel>()
|
||||
|
||||
// TODO : Add support for call logs in magic search
|
||||
// TODO? : Add support for call logs in magic search
|
||||
val account = LinphoneUtils.getDefaultAccount()
|
||||
val logs = account?.callLogs ?: coreContext.core.callLogs
|
||||
for (callLog in logs) {
|
||||
|
|
|
|||
|
|
@ -247,11 +247,16 @@ class ContactFragment : GenericFragment() {
|
|||
|
||||
private fun inviteContactBySms(number: String) {
|
||||
Log.i("$TAG Sending SMS to [$number]")
|
||||
|
||||
val smsBody = getString(
|
||||
R.string.contact_sms_invite_content,
|
||||
getString(R.string.website_download_page)
|
||||
)
|
||||
val smsIntent: Intent = Intent().apply {
|
||||
action = Intent.ACTION_SENDTO
|
||||
data = Uri.parse("smsto:$number")
|
||||
putExtra("address", number)
|
||||
putExtra("sms_body", "Coucou <3") // TODO FIXME
|
||||
putExtra("sms_body", smsBody)
|
||||
}
|
||||
startActivity(smsIntent)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,9 +130,16 @@ class EditContactFragment : GenericFragment() {
|
|||
it.consume { refKey ->
|
||||
if (refKey.isNotEmpty()) {
|
||||
Log.i("$TAG Changes were applied, going back to details page")
|
||||
(requireActivity() as MainActivity).showGreenToast(
|
||||
getString(R.string.contact_editor_saved_changes_toast),
|
||||
R.drawable.info
|
||||
)
|
||||
goBack()
|
||||
} else {
|
||||
// TODO : show error
|
||||
(requireActivity() as MainActivity).showRedToast(
|
||||
getString(R.string.contact_editor_error_saving_changes_toast),
|
||||
R.drawable.warning_circle
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,8 +131,15 @@ class NewContactFragment : GenericFragment() {
|
|||
backPressedCallback.isEnabled = false
|
||||
goBack()
|
||||
sharedViewModel.showContactEvent.value = Event(refKey)
|
||||
(requireActivity() as MainActivity).showGreenToast(
|
||||
getString(R.string.contact_editor_saved_contact_toast),
|
||||
R.drawable.info
|
||||
)
|
||||
} else {
|
||||
// TODO : show error
|
||||
(requireActivity() as MainActivity).showRedToast(
|
||||
getString(R.string.contact_editor_error_saving_contact_toast),
|
||||
R.drawable.warning_circle
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class ContactNewOrEditViewModel @UiThread constructor() : ViewModel() {
|
|||
firstName.postValue(vCard.givenName)
|
||||
lastName.postValue(vCard.familyName)
|
||||
} else {
|
||||
// TODO ?
|
||||
// TODO ? What to do when vCard is null
|
||||
}
|
||||
|
||||
picturePath.postValue(friend.photo)
|
||||
|
|
@ -184,7 +184,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.done()
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ class ContactViewModel @UiThread constructor() : ViewModel() {
|
|||
Log.i(
|
||||
"$TAG Only 1 SIP address found for contact [${friend.name}], sending message directly"
|
||||
)
|
||||
// TODO
|
||||
// TODO: send message feature
|
||||
} else if (addressesCount == 0 && numbersCount == 1 && enablePhoneNumbers) {
|
||||
val number = friend.phoneNumbers.first()
|
||||
val address = core.interpretUrl(number, true)
|
||||
|
|
@ -392,7 +392,7 @@ class ContactViewModel @UiThread constructor() : ViewModel() {
|
|||
Log.i(
|
||||
"$TAG Only 1 phone number found for contact [${friend.name}], sending message directly"
|
||||
)
|
||||
// TODO
|
||||
// TODO: send message feature
|
||||
} else {
|
||||
Log.e("$TAG Failed to interpret phone number [$number] as SIP address")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,11 +83,11 @@ class BottomNavBarFragment : Fragment() {
|
|||
}
|
||||
|
||||
binding.setOnConversationsClicked {
|
||||
// TODO
|
||||
// TODO: chat feature
|
||||
}
|
||||
|
||||
binding.setOnMeetingsClicked {
|
||||
// TODO
|
||||
// TODO: meeting feature
|
||||
}
|
||||
|
||||
sharedViewModel.currentlyDisplayedFragment.observe(viewLifecycleOwner) {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class DrawerMenuFragment : GenericFragment() {
|
|||
}
|
||||
|
||||
binding.setRecordingsClickListener {
|
||||
// TODO FIXME
|
||||
// TODO: recordings feature
|
||||
/*val navController = (requireActivity() as MainActivity).findNavController()
|
||||
navController.navigate(R.id.action_global_recordingsFragment)
|
||||
(requireActivity() as MainActivity).closeDrawerMenu()*/
|
||||
|
|
|
|||
|
|
@ -183,6 +183,6 @@ class AccountModel @WorkerThread constructor(
|
|||
}
|
||||
|
||||
fun Account.isInSecureMode(): Boolean {
|
||||
// TODO FIXME
|
||||
// TODO FIXME: use real API when available
|
||||
return params.identityAddress?.domain == "sip.linphone.org"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,11 +87,14 @@ class AccountProfileFragment : GenericFragment() {
|
|||
}
|
||||
|
||||
binding.setSettingsClickListener {
|
||||
// TODO
|
||||
// TODO: account settings feature
|
||||
}
|
||||
|
||||
binding.setDeleteClickListener {
|
||||
// TODO
|
||||
viewModel.accountRemovedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.i("$TAG Account has been removed, leaving profile")
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.accountFoundEvent.observe(viewLifecycleOwner) {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ class AccountProfileViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
val expandDetails = MutableLiveData<Boolean>()
|
||||
|
||||
val accountRemovedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
private lateinit var account: Account
|
||||
|
||||
init {
|
||||
|
|
@ -59,7 +63,7 @@ class AccountProfileViewModel @UiThread constructor() : ViewModel() {
|
|||
accountModel.postValue(AccountModel(account))
|
||||
currentMode.postValue(
|
||||
AppUtils.getString(R.string.manage_account_secure_mode_default_title)
|
||||
) // TODO FIXME
|
||||
) // TODO: use real API when available
|
||||
registerEnabled.postValue(account.params.isRegisterEnabled)
|
||||
|
||||
sipAddress.postValue(account.params.identityAddress?.asStringUriOnly())
|
||||
|
|
@ -73,6 +77,25 @@ class AccountProfileViewModel @UiThread constructor() : ViewModel() {
|
|||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun deleteAccount() {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
if (::account.isInitialized) {
|
||||
val authInfo = account.findAuthInfo()
|
||||
if (authInfo != null) {
|
||||
Log.i("$TAG Found auth info for account, removing it")
|
||||
core.removeAuthInfo(authInfo)
|
||||
} else {
|
||||
Log.w("$TAG Failed to find matching auth info for account")
|
||||
}
|
||||
|
||||
core.removeAccount(account)
|
||||
Log.i("$TAG Account has been removed")
|
||||
accountRemovedEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun setNewPicturePath(path: String) {
|
||||
coreContext.postOnCoreThread {
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ class BottomNavBarViewModel @UiThread constructor() : ViewModel() {
|
|||
updateMissedCallsCount()
|
||||
}
|
||||
|
||||
hideConversations.value = corePreferences.disableChat || true // TODO
|
||||
hideMeetings.value = true // TODO
|
||||
hideConversations.value = corePreferences.disableChat || true // TODO: chat feature
|
||||
hideMeetings.value = true // TODO: meetings feature
|
||||
}
|
||||
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -121,11 +121,6 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
getString(R.string.toast_call_can_be_trusted),
|
||||
R.drawable.trusted
|
||||
)
|
||||
// TODO: improve
|
||||
binding.avatar.avatarBorderColor = resources.getColor(
|
||||
R.color.blue_trusted,
|
||||
requireContext().theme
|
||||
)
|
||||
binding.avatar.avatarBorderWidth = AppUtils.getDimension(
|
||||
R.dimen.avatar_trust_border_width
|
||||
).toInt()
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ZrtpSasConfirmationDialogModel @UiThread constructor(
|
|||
init {
|
||||
message.value = "Dites $authTokenToRead et cliquez sur les lettres données par votre interlocuteur :"
|
||||
|
||||
// TODO: improve algo
|
||||
// TODO: improve algo?
|
||||
val rnd = Random()
|
||||
val randomLetters1 = "${alphabet[rnd.nextInt(alphabet.length)]}${alphabet[
|
||||
rnd.nextInt(
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ class CallsViewModel @UiThread constructor() : ViewModel() {
|
|||
@WorkerThread
|
||||
override fun onNewAlertTriggered(core: Core, alert: Alert) {
|
||||
val remote = alert.call.remoteAddress.asStringUriOnly()
|
||||
// TODO: differentiate WiFi from Cellular
|
||||
Log.w("$TAG Alert of type [${alert.type}] triggered for call from [$remote]")
|
||||
alert.addListener(alertListener)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@
|
|||
<variable
|
||||
name="settingsClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="deleteClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.ui.main.settings.viewmodel.AccountProfileViewModel" />
|
||||
|
|
@ -384,7 +381,7 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/action_settings"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:onClick="@{deleteClickListener}"
|
||||
android:onClick="@{() -> viewModel.deleteAccount()}"
|
||||
style="@style/context_menu_danger_action_label_style"
|
||||
android:id="@+id/action_delete"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
app:avatarViewPlaceholder="@drawable/contact_avatar"
|
||||
app:avatarViewShape="circle"
|
||||
app:avatarViewBorderWidth="0dp"
|
||||
app:avatarViewBorderColor="@color/blue_trusted"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintEnd_toEndOf="@id/background"
|
||||
app:layout_constraintStart_toStartOf="@id/background"
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<string name="help_advanced_send_debug_logs_email_address" translatable="false">linphone-android@belledonne-communications.com</string>
|
||||
|
||||
<string name="website_contact_page" translatable="false">https://linphone.org/contact</string>
|
||||
<string name="website_download_page" translatable="false">https://linphone.org/download</string>
|
||||
<string name="privacy_policy_url" translatable="false">https://linphone.org/privacy-policy</string>
|
||||
<string name="terms_and_conditions_url" translatable="false">https://linphone.org/general-terms</string>
|
||||
<string name="users_web_platform" translatable="false">https://subscribe.linphone.org</string>
|
||||
|
|
@ -106,6 +107,9 @@
|
|||
<string name="assistant_secure_mode_default_title">Default</string>
|
||||
<string name="assistant_secure_mode_interoperable_title">Interoperable</string>
|
||||
<string name="assistant_secure_mode_finish_account_login">Continue</string>
|
||||
<string name="assistant_account_register_username_already_in_use_error">This account already exists</string>
|
||||
<string name="assistant_account_register_phone_number_already_in_use_error">Phone number already used</string>
|
||||
<string name="assistant_account_register_invalid_phone_number_error">Invalid phone number and/or prefix</string>
|
||||
|
||||
<string name="drawer_menu_default_account_label">Default</string>
|
||||
<string name="drawer_menu_manage_account">Manage the profile</string>
|
||||
|
|
@ -214,6 +218,10 @@
|
|||
<string name="contact_editor_last_name">Last name</string>
|
||||
<string name="contact_editor_company">Company</string>
|
||||
<string name="contact_editor_job_title">Job title</string>
|
||||
<string name="contact_editor_saved_changes_toast">Changes were successfully saved</string>
|
||||
<string name="contact_editor_error_saving_changes_toast">Failed to save changes!</string>
|
||||
<string name="contact_editor_saved_contact_toast">Contact was successfully created</string>
|
||||
<string name="contact_editor_error_saving_contact_toast">Failed to create contact!</string>
|
||||
|
||||
<string name="contact_details_numbers_and_addresses_title">Phone numbers & SIP addresses</string>
|
||||
<string name="contact_details_company_name">Company:</string>
|
||||
|
|
@ -226,6 +234,7 @@
|
|||
<string name="contact_details_remove_from_favourites">Remove from favourites</string>
|
||||
<string name="contact_details_share">Share</string>
|
||||
<string name="contact_details_delete">Delete</string>
|
||||
<string name="contact_sms_invite_content">Hello, join me on &appName;! You can download it for free at %s</string>
|
||||
|
||||
<string name="call_outgoing">Outgoing call</string>
|
||||
<string name="call_incoming">Incoming call</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue