- Timestamp:
- Sep 13, 2021, 9:25:38 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r584 r585 2107 2107 } 2108 2108 2109 uc, entity, err := dc.unmarshalEntity(target)2109 network, entity, err := dc.unmarshalEntityNetwork(target) 2110 2110 if err != nil { 2111 2111 return err 2112 2112 } 2113 entity = uc.network.casemap(entity)2113 entity = network.casemap(entity) 2114 2114 2115 2115 // TODO: support msgid criteria … … 2144 2144 switch subcommand { 2145 2145 case "BEFORE": 2146 history, err = store.LoadBeforeTime( uc.network, entity, bounds[0], time.Time{}, limit)2146 history, err = store.LoadBeforeTime(network, entity, bounds[0], time.Time{}, limit) 2147 2147 case "AFTER": 2148 history, err = store.LoadAfterTime( uc.network, entity, bounds[0], time.Now(), limit)2148 history, err = store.LoadAfterTime(network, entity, bounds[0], time.Now(), limit) 2149 2149 case "BETWEEN": 2150 2150 if bounds[0].Before(bounds[1]) { 2151 history, err = store.LoadAfterTime( uc.network, entity, bounds[0], bounds[1], limit)2151 history, err = store.LoadAfterTime(network, entity, bounds[0], bounds[1], limit) 2152 2152 } else { 2153 history, err = store.LoadBeforeTime( uc.network, entity, bounds[0], bounds[1], limit)2153 history, err = store.LoadBeforeTime(network, entity, bounds[0], bounds[1], limit) 2154 2154 } 2155 2155 case "TARGETS": 2156 2156 // TODO: support TARGETS in multi-upstream mode 2157 targets, err := store.ListTargets( uc.network, bounds[0], bounds[1], limit)2157 targets, err := store.ListTargets(network, bounds[0], bounds[1], limit) 2158 2158 if err != nil { 2159 2159 dc.logger.Printf("failed fetching targets for chathistory: %v", target, err) … … 2166 2166 dc.SendBatch("draft/chathistory-targets", nil, nil, func(batchRef irc.TagValue) { 2167 2167 for _, target := range targets { 2168 if ch := uc.network.channels.Value(target.Name); ch != nil && ch.Detached {2168 if ch := network.channels.Value(target.Name); ch != nil && ch.Detached { 2169 2169 continue 2170 2170 } … … 2189 2189 for _, msg := range history { 2190 2190 msg.Tags["batch"] = batchRef 2191 dc.SendMessage(dc.marshalMessage(msg, uc.network))2191 dc.SendMessage(dc.marshalMessage(msg, network)) 2192 2192 } 2193 2193 })
Note:
See TracChangeset
for help on using the changeset viewer.