Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
6d1593fc
Commit
6d1593fc
authored
2 months ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
linkdevice: set proxy settings when importing
Change-Id: I25d51a9574a2fee05507065b392f18714eefbccb
parent
a23c5f2a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
jami-android/app/src/main/java/cx/ring/linkdevice/viewmodel/ImportSideViewModel.kt
+13
-1
13 additions, 1 deletion
.../java/cx/ring/linkdevice/viewmodel/ImportSideViewModel.kt
with
13 additions
and
1 deletion
jami-android/app/src/main/java/cx/ring/linkdevice/viewmodel/ImportSideViewModel.kt
+
13
−
1
View file @
6d1593fc
...
@@ -31,6 +31,7 @@ import net.jami.model.AccountConfig
...
@@ -31,6 +31,7 @@ import net.jami.model.AccountConfig
import
net.jami.model.ConfigKey
import
net.jami.model.ConfigKey
import
net.jami.services.AccountService
import
net.jami.services.AccountService
import
net.jami.services.AccountService.AuthError
import
net.jami.services.AccountService.AuthError
import
net.jami.services.DeviceRuntimeService
import
net.jami.utils.Log
import
net.jami.utils.Log
import
javax.inject.Inject
import
javax.inject.Inject
import
javax.inject.Named
import
javax.inject.Named
...
@@ -54,7 +55,8 @@ sealed class AddDeviceImportState {
...
@@ -54,7 +55,8 @@ sealed class AddDeviceImportState {
@HiltViewModel
@HiltViewModel
class
ImportSideViewModel
@Inject
constructor
(
class
ImportSideViewModel
@Inject
constructor
(
private
val
accountService
:
AccountService
,
private
val
accountService
:
AccountService
,
@
param
:
Named
(
"UiScheduler"
)
private
val
mUiScheduler
:
Scheduler
@
param
:
Named
(
"UiScheduler"
)
private
val
mUiScheduler
:
Scheduler
,
private
val
mDeviceService
:
DeviceRuntimeService
,
)
:
AuthStateListener
,
ViewModel
()
{
)
:
AuthStateListener
,
ViewModel
()
{
// Expose screen UI state
// Expose screen UI state
...
@@ -71,6 +73,7 @@ class ImportSideViewModel @Inject constructor(
...
@@ -71,6 +73,7 @@ class ImportSideViewModel @Inject constructor(
accountService
.
getAccountTemplate
(
AccountConfig
.
ACCOUNT_TYPE_JAMI
)
accountService
.
getAccountTemplate
(
AccountConfig
.
ACCOUNT_TYPE_JAMI
)
.
flatMapObservable
{
accountDetails
:
HashMap
<
String
,
String
>
->
.
flatMapObservable
{
accountDetails
:
HashMap
<
String
,
String
>
->
accountDetails
[
ConfigKey
.
ARCHIVE_URL
.
key
]
=
"jami-auth"
accountDetails
[
ConfigKey
.
ARCHIVE_URL
.
key
]
=
"jami-auth"
setProxyDetails
(
accountDetails
)
accountService
.
addAccount
(
accountDetails
)
accountService
.
addAccount
(
accountDetails
)
}
}
.
firstOrError
()
.
firstOrError
()
...
@@ -83,6 +86,15 @@ class ImportSideViewModel @Inject constructor(
...
@@ -83,6 +86,15 @@ class ImportSideViewModel @Inject constructor(
.
apply
{
compositeDisposable
.
add
(
this
)
}
.
apply
{
compositeDisposable
.
add
(
this
)
}
}
}
private
fun
setProxyDetails
(
details
:
MutableMap
<
String
,
String
>)
{
details
[
ConfigKey
.
PROXY_ENABLED
.
key
]
=
AccountConfig
.
TRUE_STR
val
pushToken
=
mDeviceService
.
pushToken
if
(
pushToken
.
isNotEmpty
())
{
details
[
ConfigKey
.
PROXY_PUSH_TOKEN
.
key
]
=
pushToken
details
[
ConfigKey
.
PROXY_PUSH_PLATFORM
.
key
]
=
mDeviceService
.
pushPlatform
}
}
fun
onAuthentication
(
password
:
String
=
""
)
{
fun
onAuthentication
(
password
:
String
=
""
)
{
_tempAccount
?.
accountId
?.
apply
{
_tempAccount
?.
accountId
?.
apply
{
accountService
.
provideAccountAuthentication
(
this
,
password
)
accountService
.
provideAccountAuthentication
(
this
,
password
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment