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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
7a0ab9f7
Commit
7a0ab9f7
authored
6 months ago
by
Adrien Béraud
Committed by
Adrien Béraud
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
contacts: remove status cache, prevent dead state
Change-Id: I7848c6b1e087d0a81820b031a889275edbf1b2a7
parent
a7c410ee
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/libjamiclient/src/main/kotlin/net/jami/model/Contact.kt
+3
-4
3 additions, 4 deletions
...d/libjamiclient/src/main/kotlin/net/jami/model/Contact.kt
with
3 additions
and
4 deletions
jami-android/libjamiclient/src/main/kotlin/net/jami/model/Contact.kt
+
3
−
4
View file @
7a0ab9f7
...
...
@@ -30,8 +30,6 @@ class Contact constructor(val uri: Uri, val isUser: Boolean = false) {
var
username
:
Single
<
String
>?
=
null
var
presenceUpdates
:
Observable
<
PresenceStatus
>?
=
null
/** Cache presence in case the daemon emits presence updates without subscription */
private
var
cachedPresence
:
PresenceStatus
=
PresenceStatus
.
OFFLINE
private
var
mContactPresenceEmitter
:
Emitter
<
PresenceStatus
>?
=
null
private
val
profileSubject
:
Subject
<
Single
<
Profile
>>
=
BehaviorSubject
.
create
()
val
profile
:
Observable
<
Profile
>
=
profileSubject
.
switchMapSingle
{
single
->
single
}
...
...
@@ -66,12 +64,14 @@ class Contact constructor(val uri: Uri, val isUser: Boolean = false) {
get
()
=
mContactUpdates
fun
setPresenceEmitter
(
emitter
:
Emitter
<
PresenceStatus
>?)
{
emitter
?.
onNext
(
cachedPresence
)
mContactPresenceEmitter
?.
let
{
e
->
if
(
e
!=
emitter
)
e
.
onComplete
()
}
mContactPresenceEmitter
=
emitter
if
(
emitter
==
null
)
{
presenceUpdates
=
null
}
}
enum
class
PresenceStatus
{
...
...
@@ -81,7 +81,6 @@ class Contact constructor(val uri: Uri, val isUser: Boolean = false) {
}
fun
setPresence
(
present
:
PresenceStatus
)
{
cachedPresence
=
present
mContactPresenceEmitter
?.
onNext
(
present
)
}
...
...
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