Remove network.upstream
This is an artifact from when we used locks. No need for this anymore.
This commit is contained in:
parent
c4655f1492
commit
e7e4311160
@ -134,7 +134,7 @@ func (dc *downstreamConn) upstream() *upstreamConn {
|
||||
if dc.network == nil {
|
||||
return nil
|
||||
}
|
||||
return dc.network.upstream()
|
||||
return dc.network.conn
|
||||
}
|
||||
|
||||
func isOurNick(net *network, nick string) bool {
|
||||
|
@ -245,7 +245,7 @@ func handleServiceNetworkStatus(dc *downstreamConn, params []string) error {
|
||||
dc.user.forEachNetwork(func(net *network) {
|
||||
var statuses []string
|
||||
var details string
|
||||
if uc := net.upstream(); uc != nil {
|
||||
if uc := net.conn; uc != nil {
|
||||
if dc.nick != uc.nick {
|
||||
statuses = append(statuses, "connected as "+uc.nick)
|
||||
} else {
|
||||
|
13
user.go
13
user.go
@ -129,10 +129,6 @@ func (net *network) run() {
|
||||
}
|
||||
}
|
||||
|
||||
func (net *network) upstream() *upstreamConn {
|
||||
return net.conn
|
||||
}
|
||||
|
||||
func (net *network) Stop() {
|
||||
select {
|
||||
case <-net.stopped:
|
||||
@ -141,8 +137,8 @@ func (net *network) Stop() {
|
||||
close(net.stopped)
|
||||
}
|
||||
|
||||
if uc := net.upstream(); uc != nil {
|
||||
uc.Close()
|
||||
if net.conn != nil {
|
||||
net.conn.Close()
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,11 +196,10 @@ func (u *user) forEachNetwork(f func(*network)) {
|
||||
|
||||
func (u *user) forEachUpstream(f func(uc *upstreamConn)) {
|
||||
for _, network := range u.networks {
|
||||
uc := network.upstream()
|
||||
if uc == nil {
|
||||
if network.conn == nil {
|
||||
continue
|
||||
}
|
||||
f(uc)
|
||||
f(network.conn)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user