mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 05:42:46 +00:00
Simplify presence stringification (should help with vector-im/element-android#5712)
This commit is contained in:
parent
99f2007eb6
commit
99ef547295
7 changed files with 36 additions and 87 deletions
|
@ -111,10 +111,15 @@ func (p *PresenceStreamProvider) IncrementalSync(
|
|||
continue
|
||||
}
|
||||
}
|
||||
presence.ClientFields.LastActiveAgo = presence.LastActiveAgo()
|
||||
if presence.ClientFields.Presence == "online" {
|
||||
currentlyActive := presence.CurrentlyActive()
|
||||
presence.ClientFields.CurrentlyActive = ¤tlyActive
|
||||
|
||||
if _, known := types.PresenceFromString(presence.ClientFields.Presence); known {
|
||||
presence.ClientFields.LastActiveAgo = presence.LastActiveAgo()
|
||||
if presence.ClientFields.Presence == "online" {
|
||||
currentlyActive := presence.CurrentlyActive()
|
||||
presence.ClientFields.CurrentlyActive = ¤tlyActive
|
||||
}
|
||||
} else {
|
||||
presence.ClientFields.Presence = "offline"
|
||||
}
|
||||
|
||||
content, err := json.Marshal(presence.ClientFields)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue