- Timestamp:
- Apr 1, 2020, 10:16:32 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r197 r198 55 55 caps map[string]string 56 56 batches map[string]batch 57 away bool 57 58 58 59 tagsSupported bool … … 1270 1271 case "ACK": 1271 1272 // Ignore 1273 case irc.RPL_NOWAWAY, irc.RPL_UNAWAY: 1274 // Ignore 1272 1275 case irc.RPL_YOURHOST, irc.RPL_CREATED: 1273 1276 // Ignore … … 1484 1487 } 1485 1488 } 1489 1490 func (uc *upstreamConn) updateAway() { 1491 away := true 1492 uc.forEachDownstream(func(*downstreamConn) { 1493 away = false 1494 }) 1495 if away == uc.away { 1496 return 1497 } 1498 if away { 1499 uc.SendMessage(&irc.Message{ 1500 Command: "AWAY", 1501 Params: []string{"Auto away"}, 1502 }) 1503 } else { 1504 uc.SendMessage(&irc.Message{ 1505 Command: "AWAY", 1506 }) 1507 } 1508 uc.away = away 1509 } -
trunk/user.go
r197 r198 176 176 switch e := e.(type) { 177 177 case eventUpstreamConnected: 178 // Nothing to do 178 uc := e.uc 179 uc.updateAway() 179 180 case eventUpstreamDisconnected: 180 181 uc := e.uc … … 201 202 202 203 u.downstreamConns = append(u.downstreamConns, dc) 204 205 u.forEachUpstream(func(uc *upstreamConn) { 206 uc.updateAway() 207 }) 203 208 case eventDownstreamDisconnected: 204 209 dc := e.dc … … 209 214 } 210 215 } 216 217 u.forEachUpstream(func(uc *upstreamConn) { 218 uc.updateAway() 219 }) 211 220 case eventDownstreamMessage: 212 221 msg, dc := e.msg, e.dc
Note:
See TracChangeset
for help on using the changeset viewer.