Changeset 781 in code for trunk/bridge.go
- Timestamp:
- Feb 11, 2022, 6:41:46 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bridge.go
r764 r781 2 2 3 3 import ( 4 "context" 5 "fmt" 4 6 "strconv" 5 7 "strings" … … 8 10 ) 9 11 10 func forwardChannel( dc *downstreamConn, ch *upstreamChannel) {12 func forwardChannel(ctx context.Context, dc *downstreamConn, ch *upstreamChannel) { 11 13 if !ch.complete { 12 14 panic("Tried to forward a partial channel") … … 17 19 sendTopic(dc, ch) 18 20 } 21 22 if dc.caps["soju.im/read"] { 23 channelCM := ch.conn.network.casemap(ch.Name) 24 r, err := dc.srv.db.GetReadReceipt(ctx, ch.conn.network.ID, channelCM) 25 if err != nil { 26 dc.logger.Printf("failed to get the read receipt for %q: %v", ch.Name, err) 27 } else { 28 timestampStr := "*" 29 if r != nil { 30 timestampStr = fmt.Sprintf("timestamp=%s", r.Timestamp.UTC().Format(serverTimeLayout)) 31 } 32 dc.SendMessage(&irc.Message{ 33 Prefix: dc.prefix(), 34 Command: "READ", 35 Params: []string{dc.marshalEntity(ch.conn.network, ch.Name), timestampStr}, 36 }) 37 } 38 } 39 19 40 sendNames(dc, ch) 20 41 }
Note:
See TracChangeset
for help on using the changeset viewer.