blob: 5fa59b5eca416b0edd1c4750ece5625ea782c4c2 [file] [log] [blame]
Adrià Vilanova Martínez7c1a3c12024-12-05 15:34:40 +01001import { Modifier } from "./types";
2
3const createMessageRemoveParentRef: Modifier = {
Adrià Vilanova Martínez4fb615f2023-02-04 18:55:16 +01004 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ínez7c1a3c12024-12-05 15:34:40 +010011 async interceptor(response) {
Adrià Vilanova Martínez4fb615f2023-02-04 18:55:16 +010012 // Remove parent_message_id value (field 37)
13 delete response[37];
14 return response;
15 }
16};
17
18export default createMessageRemoveParentRef;