Adrià Vilanova Martínez | 7c1a3c1 | 2024-12-05 15:34:40 +0100 | [diff] [blame^] | 1 | import { Modifier } from "./types"; |
| 2 | |
| 3 | const createMessageRemoveParentRef: Modifier = { |
Adrià Vilanova Martínez | 4fb615f | 2023-02-04 18:55:16 +0100 | [diff] [blame] | 4 | urlRegex: /api\/CreateMessage/i, |
| 5 | featureGated: true, |
| 6 | features: ['flattenthreads', 'flattenthreads_switch_enabled'], |
| 7 | isEnabled(options) { |
| 8 | return options['flattenthreads'] && |
| 9 | options['flattenthreads_switch_enabled']; |
| 10 | }, |
Adrià Vilanova Martínez | 7c1a3c1 | 2024-12-05 15:34:40 +0100 | [diff] [blame^] | 11 | async interceptor(response) { |
Adrià Vilanova Martínez | 4fb615f | 2023-02-04 18:55:16 +0100 | [diff] [blame] | 12 | // Remove parent_message_id value (field 37) |
| 13 | delete response[37]; |
| 14 | return response; |
| 15 | } |
| 16 | }; |
| 17 | |
| 18 | export default createMessageRemoveParentRef; |