Changeset 428 in code for trunk/upstream.go
- Timestamp:
- Nov 24, 2020, 1:13:24 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r423 r428 1608 1608 } 1609 1609 1610 func (uc *upstreamConn) appendLog(entity string, msg *irc.Message) { 1610 // appendLog appends a message to the log file. 1611 // 1612 // The internal message ID is returned. If the message isn't recorded in the 1613 // log file, an empty string is returned. 1614 func (uc *upstreamConn) appendLog(entity string, msg *irc.Message) (msgID string) { 1611 1615 if uc.user.msgStore == nil { 1612 return 1616 return "" 1613 1617 } 1614 1618 … … 1623 1627 if err != nil { 1624 1628 uc.logger.Printf("failed to log message: failed to get last message ID: %v", err) 1625 return 1629 return "" 1626 1630 } 1627 1631 … … 1647 1651 if err != nil { 1648 1652 uc.logger.Printf("failed to log message: %v", err) 1649 return 1650 } 1651 1652 if !detached && msgID != "" { 1653 uc.forEachDownstream(func(dc *downstreamConn) { 1654 history.clients[dc.clientName] = msgID 1655 }) 1656 } 1653 return "" 1654 } 1655 1656 return msgID 1657 1657 } 1658 1658 … … 1663 1663 // forwarded to all connections except origin. 1664 1664 func (uc *upstreamConn) produce(target string, msg *irc.Message, origin *downstreamConn) { 1665 var msgID string 1665 1666 if target != "" { 1666 uc.appendLog(target, msg)1667 msgID = uc.appendLog(target, msg) 1667 1668 } 1668 1669 … … 1674 1675 uc.forEachDownstream(func(dc *downstreamConn) { 1675 1676 if dc != origin || dc.caps["echo-message"] { 1676 dc.SendMessage(dc.marshalMessage(msg, uc.network)) 1677 dc.sendMessageWithID(dc.marshalMessage(msg, uc.network), msgID) 1678 } else { 1679 dc.advanceMessageWithID(msg, msgID) 1677 1680 } 1678 1681 })
Note:
See TracChangeset
for help on using the changeset viewer.