- Timestamp:
- Mar 28, 2020, 4:36:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r184 r185 688 688 } 689 689 690 firstDownstream := len(dc.user.downstreamConns) == 0 690 // Only send history if we're the first connected client with that name and 691 // network 692 sendHistory := true 693 dc.user.forEachDownstream(func(conn *downstreamConn) { 694 if dc.clientName == conn.clientName && dc.network == conn.network { 695 sendHistory = false 696 } 697 }) 691 698 692 699 dc.SendMessage(&irc.Message{ … … 732 739 733 740 dc.forEachNetwork(func(net *network) { 734 // TODO: need to take dc.network into account when deciding whether or 735 // not to load history 736 dc.runNetwork(net, firstDownstream) 741 dc.runNetwork(net, sendHistory) 737 742 }) 738 743 … … 749 754 } 750 755 751 historyName := dc.rawUsername752 753 756 var seqPtr *uint64 754 757 if loadHistory { 755 758 net.lock.Lock() 756 seq, ok := net.history[ historyName]759 seq, ok := net.history[dc.clientName] 757 760 net.lock.Unlock() 758 761 if ok { … … 781 784 } 782 785 786 // TODO: close the consumer from the user goroutine, so we don't need 787 // that net.history lock 783 788 seq := consumer.Close() 784 789 785 790 net.lock.Lock() 786 net.history[ historyName] = seq791 net.history[dc.clientName] = seq 787 792 net.lock.Unlock() 788 793 }()
Note:
See TracChangeset
for help on using the changeset viewer.