3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

simplify read of lastSeen

This commit is contained in:
Shivaram Lingamneni 2020-03-02 02:52:51 -05:00
parent e7c1800893
commit d72037725b

View File

@ -1624,6 +1624,7 @@ func (client *Client) performWrite() {
dirtyBits := client.dirtyBits
client.dirtyBits = 0
account := client.account
lastSeen := client.lastSeen
client.stateMutex.Unlock()
if account == "" {
@ -1640,9 +1641,6 @@ func (client *Client) performWrite() {
client.server.accounts.saveChannels(account, channelNames)
}
if (dirtyBits & IncludeLastSeen) != 0 {
client.stateMutex.RLock()
lastSeen := client.lastSeen
client.stateMutex.RUnlock()
client.server.accounts.saveLastSeen(account, lastSeen)
}
}