Skip to content
Snippets Groups Projects
Commit 9c20ce90 authored by Adrien Béraud's avatar Adrien Béraud Committed by Pierre Nicolas
Browse files

save archive with extension .jac

GitLab: jami-client-qt#1256

Change-Id: I0e3e5e358b439e9df7fe0483bec60fe86577fcc8
parent 8703317d
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,6 @@ import net.jami.model.Account
import net.jami.model.Contact
import net.jami.model.Profile
import net.jami.services.AccountService
import net.jami.utils.VCardUtils
import java.io.File
import javax.inject.Inject
......@@ -225,14 +224,10 @@ class JamiAccountSummaryFragment :
}
//=============== AppBar management end ===================
fun setAccount(accountId: String) {
presenter.setAccountId(accountId)
}
override fun accountChanged(account: Account, profile: Profile) {
mAccount = account
mBestName = account.registeredName.ifEmpty { account.displayUsername ?: account.username!! }
mBestName = "$mBestName.gz"
val bestName = account.registeredName.ifEmpty { account.displayUsername ?: account.username!! }
mBestName = "$bestName.jac"
mBinding?.let { binding ->
binding.userPhoto.setImageDrawable(AvatarDrawable.build(binding.root.context, account, profile, true))
binding.username.setText(profile.displayName)
......@@ -255,7 +250,7 @@ class JamiAccountSummaryFragment :
QRCodeFragment.newInstance(
QRCodeFragment.MODE_SCAN or QRCodeFragment.MODE_SHARE,
QRCodeFragment.MODE_SHARE,
net.jami.model.Uri.fromString(account.uri!!)
Uri.fromString(account.uri!!)
).show(parentFragmentManager, QRCodeFragment.TAG)
}
binding.username.setOnEditorActionListener { _, actionId, _ ->
......@@ -808,7 +803,6 @@ class JamiAccountSummaryFragment :
val TAG = JamiAccountSummaryFragment::class.simpleName!!
private val FRAGMENT_DIALOG_RENAME = "$TAG.dialog.deviceRename"
private val FRAGMENT_DIALOG_PASSWORD = "$TAG.dialog.changePassword"
private val FRAGMENT_DIALOG_BACKUP = "$TAG.dialog.backup"
private fun slideAnimator(start: Int, end: Int, summary: View) = ValueAnimator.ofInt(start, end).apply {
addUpdateListener { valueAnimator: ValueAnimator ->
......
......@@ -89,11 +89,11 @@ class JamiAccountSummaryPresenter @Inject constructor(
val deviceName: String?
get() = mAccountService.getAccount(mAccountID)?.deviceName
fun downloadAccountsArchive(dest: File, scheme: String, password: String?) {
fun downloadAccountsArchive(dest: File, scheme: String, password: String) {
val accountId = mAccountID ?: return
view?.showExportingProgressDialog()
mCompositeDisposable.add(
mAccountService.exportToFile(accountId, dest.absolutePath, scheme, password!!)
mAccountService.exportToFile(accountId, dest.absolutePath, scheme, password)
.observeOn(mUiScheduler)
.subscribe({ view?.displayCompleteArchive(dest) })
{ view?.passwordChangeEnded(accountId, false) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment