Download this file
| 1 | package thin |
| 2 | |
| 3 | import ( |
| 4 | "slices" |
| 5 | |
| 6 | "amadan.net/oficina/equipo/internal/wire" |
| 7 | ) |
| 8 | |
| 9 | // toolPlacesOld: the instance cannot take a place tool yet (below |
| 10 | // wire.ProtocolPlaces). For the model; people never read it. |
| 11 | const toolPlacesOld = "Equipo needs an update before it can say where sites go or offer to publish one. Tell the person that in one line." |
| 12 | |
| 13 | // placesRefused answers a place tool here on a link below protocol 31: |
| 14 | // Encode refuses the call, so it is never sent to an older instance. |
| 15 | func placesRefused(call wire.ToolCall, protocol int) (wire.ToolResult, bool) { |
| 16 | if !slices.Contains(wire.PlacesTools, call.Name) || protocol == 0 || protocol >= wire.ProtocolPlaces { |
| 17 | return wire.ToolResult{}, false |
| 18 | } |
| 19 | return wire.ToolResult{CallID: call.CallID, IsError: true, Code: "places_unsupported", Text: toolPlacesOld}, true |
| 20 | } |
| 21 | |