Changeset 499 in code for trunk/downstream.go
- Timestamp:
- Apr 13, 2021, 5:11:05 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r496 r499 1031 1031 return 1032 1032 } 1033 if ch := net.channels.Value(target); ch != nil && ch.Detached { 1034 return 1035 } 1033 1034 ch := net.channels.Value(target) 1036 1035 1037 1036 limit := 4000 … … 1057 1056 } 1058 1057 1059 if dc.caps["batch"] { 1060 msg.Tags["batch"] = irc.TagValue(batchRef) 1061 } 1062 dc.SendMessage(dc.marshalMessage(msg, net)) 1058 if ch != nil && ch.Detached { 1059 if net.detachedMessageNeedsRelay(ch, msg) { 1060 dc.relayDetachedMessage(net, msg) 1061 } 1062 } else { 1063 if dc.caps["batch"] { 1064 msg.Tags["batch"] = irc.TagValue(batchRef) 1065 } 1066 dc.SendMessage(dc.marshalMessage(msg, net)) 1067 } 1063 1068 } 1064 1069 … … 1069 1074 Params: []string{"-" + batchRef}, 1070 1075 }) 1076 } 1077 } 1078 1079 func (dc *downstreamConn) relayDetachedMessage(net *network, msg *irc.Message) { 1080 if msg.Command != "PRIVMSG" && msg.Command != "NOTICE" { 1081 return 1082 } 1083 1084 sender := msg.Prefix.Name 1085 target, text := msg.Params[0], msg.Params[1] 1086 if net.isHighlight(msg) { 1087 sendServiceNOTICE(dc, fmt.Sprintf("highlight in %v: <%v> %v", dc.marshalEntity(net, target), sender, text)) 1088 } else { 1089 sendServiceNOTICE(dc, fmt.Sprintf("message in %v: <%v> %v", dc.marshalEntity(net, target), sender, text)) 1071 1090 } 1072 1091 }
Note:
See TracChangeset
for help on using the changeset viewer.