Changeset 284 in code for trunk/upstream.go
- Timestamp:
- May 1, 2020, 1:18:14 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r282 r284 1406 1406 // appendHistory appends a message to the history. entity can be empty. 1407 1407 func (uc *upstreamConn) appendHistory(entity string, msg *irc.Message) { 1408 detached := false 1409 if ch, ok := uc.network.channels[entity]; ok { 1410 detached = ch.Detached 1411 } 1412 1408 1413 // If no client is offline, no need to append the message to the buffer 1409 if len(uc.network.offlineClients) == 0 {1414 if len(uc.network.offlineClients) == 0 && !detached { 1410 1415 return 1411 1416 } … … 1421 1426 for clientName, _ := range uc.network.offlineClients { 1422 1427 history.offlineClients[clientName] = 0 1428 } 1429 1430 if detached { 1431 // If the channel is detached, online clients act as offline 1432 // clients too 1433 uc.forEachDownstream(func(dc *downstreamConn) { 1434 history.offlineClients[dc.clientName] = 0 1435 }) 1423 1436 } 1424 1437 } … … 1439 1452 uc.appendHistory(target, msg) 1440 1453 1454 // Don't forward messages if it's a detached channel 1455 if ch, ok := uc.network.channels[target]; ok && ch.Detached { 1456 return 1457 } 1458 1441 1459 uc.forEachDownstream(func(dc *downstreamConn) { 1442 1460 if dc != origin || dc.caps["echo-message"] {
Note:
See TracChangeset
for help on using the changeset viewer.