|
@@ -307,7 +307,6 @@ func (server *Server) RunClient(conn IRCConn) {
|
307
|
307
|
// give them 1k of grace over the limit:
|
308
|
308
|
socket := NewSocket(conn, config.Server.MaxSendQBytes)
|
309
|
309
|
client := &Client{
|
310
|
|
- lastSeen: make(map[string]time.Time),
|
311
|
310
|
lastActive: now,
|
312
|
311
|
channels: make(ChannelSet),
|
313
|
312
|
ctime: now,
|
|
@@ -369,11 +368,8 @@ func (server *Server) RunClient(conn IRCConn) {
|
369
|
368
|
func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string, lastSeen map[string]time.Time, uModes modes.Modes) {
|
370
|
369
|
now := time.Now().UTC()
|
371
|
370
|
config := server.Config()
|
372
|
|
- if lastSeen == nil {
|
373
|
|
- lastSeen = make(map[string]time.Time)
|
374
|
|
- if account.Settings.AutoreplayMissed {
|
375
|
|
- lastSeen[""] = now
|
376
|
|
- }
|
|
371
|
+ if lastSeen == nil && account.Settings.AutoreplayMissed {
|
|
372
|
+ lastSeen = map[string]time.Time{"": now}
|
377
|
373
|
}
|
378
|
374
|
|
379
|
375
|
client := &Client{
|
|
@@ -746,6 +742,9 @@ func (client *Client) Touch(active bool, session *Session) {
|
746
|
742
|
}
|
747
|
743
|
|
748
|
744
|
func (client *Client) setLastSeen(now time.Time, deviceID string) {
|
|
745
|
+ if client.lastSeen == nil {
|
|
746
|
+ client.lastSeen = make(map[string]time.Time)
|
|
747
|
+ }
|
749
|
748
|
client.lastSeen[deviceID] = now
|
750
|
749
|
// evict the least-recently-used entry if necessary
|
751
|
750
|
if maxDeviceIDsPerClient < len(client.lastSeen) {
|