mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #2252
Fix SAREGISTER creating always-on clients with no user modes. Also fix UNREGISTER/ERASE not deleting the stored push subscriptions.
This commit is contained in:
parent
808799b100
commit
686ce4d5b2
4 changed files with 14 additions and 7 deletions
|
|
@ -110,8 +110,8 @@ func (client *Client) AddSession(session *Session) (success bool, numSessions in
|
|||
newSessions[len(newSessions)-1] = session
|
||||
if client.accountSettings.AutoreplayMissed || session.deviceID != "" {
|
||||
lastSeen = client.lastSeen[session.deviceID]
|
||||
client.setLastSeen(time.Now().UTC(), session.deviceID)
|
||||
}
|
||||
client.setLastSeen(time.Now().UTC(), session.deviceID)
|
||||
client.sessions = newSessions
|
||||
wasAway = client.awayMessage
|
||||
if client.autoAwayEnabledNoMutex(config) {
|
||||
|
|
@ -496,6 +496,9 @@ func (client *Client) checkAlwaysOnExpirationNoMutex(config *Config, ignoreRegis
|
|||
if !((client.registered || ignoreRegistration) && client.alwaysOn) {
|
||||
return false
|
||||
}
|
||||
if len(client.lastSeen) == 0 {
|
||||
return true // #2252: do not precreate the client if it was never logged into at all
|
||||
}
|
||||
deadline := time.Duration(config.Accounts.Multiclient.AlwaysOnExpiration)
|
||||
if deadline == 0 {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue