| 1 | package main |
| 2 | |
| 3 | import "reasonix/internal/provider" |
| 4 | |
| 5 | // historyServerSearch copies card-visible search fields and drops encrypted |
| 6 | // replay payloads. Those stay on the session message for the next provider turn. |
| 7 | func historyServerSearch(in []provider.ServerSearchCall) []provider.ServerSearchCall { |
| 8 | if len(in) == 0 { |
| 9 | return nil |
| 10 | } |
| 11 | out := make([]provider.ServerSearchCall, 0, len(in)) |
| 12 | for _, search := range in { |
| 13 | copied := provider.ServerSearchCall{ID: search.ID, Query: search.Query, SourcesStatus: search.SourcesStatus} |
| 14 | if len(search.Results) > 0 { |
| 15 | copied.Results = append([]provider.ServerSearchHit(nil), search.Results...) |
| 16 | } |
| 17 | out = append(out, copied) |
| 18 | } |
| 19 | return out |
| 20 | } |
| 21 |