Changeset 482 in code for trunk/downstream.go


Ignore:
Timestamp:
Mar 29, 2021, 2:55:57 PM (4 years ago)
Author:
contact
Message:

Simplify network.offlineClients

Replace it with a list of all clients (online or offline).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r480 r482  
    991991                // Only send history if we're the first connected client with that name
    992992                // for the network
    993                 if _, ok := net.offlineClients[dc.clientName]; ok {
     993                firstClient := true
     994                dc.user.forEachDownstream(func(c *downstreamConn) {
     995                        if c != dc && c.clientName == dc.clientName && c.network == dc.network {
     996                                firstClient = false
     997                        }
     998                })
     999                if firstClient {
    9941000                        dc.sendNetworkBacklog(net)
    995                         delete(net.offlineClients, dc.clientName)
    9961001                }
    9971002
Note: See TracChangeset for help on using the changeset viewer.