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
3b76bfd7
Commit
3b76bfd7
authored
2 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
account: propagate registration from details
Change-Id: I3f04629f73b294026e161622273e4f647d1cebbd
parent
cf9f7b07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jami-android/libjamiclient/src/main/kotlin/net/jami/model/Account.kt
+7
-8
7 additions, 8 deletions
...d/libjamiclient/src/main/kotlin/net/jami/model/Account.kt
with
7 additions
and
8 deletions
jami-android/libjamiclient/src/main/kotlin/net/jami/model/Account.kt
+
7
−
8
View file @
3b76bfd7
...
...
@@ -69,7 +69,7 @@ class Account(
private
val
contactLocations
:
MutableMap
<
Contact
,
Observable
<
ContactLocation
>>
=
HashMap
()
private
val
mLocationSubject
:
Subject
<
Map
<
Contact
,
Observable
<
ContactLocation
>>>
=
BehaviorSubject
.
createDefault
(
contactLocations
)
private
val
mLocationStartedSubject
:
Subject
<
ContactLocationEntry
>
=
PublishSubject
.
create
()
private
val
registrationStateSubject
=
BehaviorSubject
.
createDefault
(
AccountConfig
.
RegistrationState
.
UNLOADED
)
private
val
registrationStateSubject
=
BehaviorSubject
.
createDefault
(
AccountConfig
.
RegistrationState
.
valueOf
(
mVolatileDetails
[
ConfigKey
.
ACCOUNT_REGISTRATION_STATUS
])
)
var
historyLoader
:
Single
<
Account
>?
=
null
var
loadedProfile
:
Single
<
Profile
>?
=
null
...
...
@@ -90,7 +90,7 @@ class Account(
//trustRequestsSubject.onComplete();
}
fun
canSearch
():
Boolean
=
!
getDetail
(
ConfigKey
.
MANAGER_URI
).
is
NullOr
Empty
()
fun
canSearch
():
Boolean
=
!
getDetail
(
ConfigKey
.
MANAGER_URI
).
isEmpty
()
fun
isContact
(
conversation
:
Conversation
):
Boolean
=
conversation
.
contact
?.
let
{
isContact
(
it
.
uri
)
}
?:
false
...
...
@@ -459,7 +459,7 @@ class Account(
val
dhtProxyUsed
:
String
get
()
=
mVolatileDetails
[
ConfigKey
.
PROXY_SERVER
]
fun
setRegistrationState
(
registeredState
:
AccountConfig
.
RegistrationState
,
code
:
Int
)
{
fun
setRegistrationState
(
registeredState
:
AccountConfig
.
RegistrationState
,
code
:
Int
=
0
)
{
//mVolatileDetails.put(ConfigKey.ACCOUNT_REGISTRATION_STATUS, registeredState)
registrationStateSubject
.
onNext
(
registeredState
)
//mVolatileDetails.put(ConfigKey.ACCOUNT_REGISTRATION_STATE_CODE, code.toString())
...
...
@@ -467,6 +467,7 @@ class Account(
fun
setVolatileDetails
(
volatileDetails
:
Map
<
String
,
String
>)
{
mVolatileDetails
=
AccountConfig
(
volatileDetails
)
setRegistrationState
(
AccountConfig
.
RegistrationState
.
valueOf
(
mVolatileDetails
[
ConfigKey
.
ACCOUNT_REGISTRATION_STATUS
]))
}
val
registeredName
:
String
...
...
@@ -481,9 +482,7 @@ class Account(
val
isJami
:
Boolean
get
()
=
config
[
ConfigKey
.
ACCOUNT_TYPE
]
==
AccountConfig
.
ACCOUNT_TYPE_JAMI
private
fun
getDetail
(
key
:
ConfigKey
):
String
?
{
return
config
[
key
]
}
private
fun
getDetail
(
key
:
ConfigKey
):
String
=
config
[
key
]
fun
getDetailBoolean
(
key
:
ConfigKey
):
Boolean
{
return
config
.
getBool
(
key
)
...
...
@@ -562,9 +561,9 @@ class Account(
fun
needsMigration
():
Boolean
=
AccountConfig
.
RegistrationState
.
ERROR_NEED_MIGRATION
==
registrationState
val
deviceId
:
String
get
()
=
getDetail
(
ConfigKey
.
ACCOUNT_DEVICE_ID
)
!!
get
()
=
getDetail
(
ConfigKey
.
ACCOUNT_DEVICE_ID
)
val
deviceName
:
String
get
()
=
getDetail
(
ConfigKey
.
ACCOUNT_DEVICE_NAME
)
!!
get
()
=
getDetail
(
ConfigKey
.
ACCOUNT_DEVICE_NAME
)
val
contacts
:
Map
<
String
,
Contact
>
get
()
=
mContacts
val
bannedContacts
:
List
<
Contact
>
...
...
This diff is collapsed.
Click to expand it.
Pierre Nicolas
@pnicolas
mentioned in issue
#1193 (closed)
·
1 year ago
mentioned in issue
#1193 (closed)
mentioned in issue #1193
Toggle commit list
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