Flatten threads: remove further info about parents

This CL removes information from the ViewThread and CreateMessage
responses which indicate that the nested messages have a parent message.

This is done because although this information is not used now to render
the replies, it might be used in the future by the Community Console
code and this might break the feature.

Bug: twpowertools:156

Change-Id: Ie32ce2b112f15395c2f15d5d6b9b5cde4cc64768
diff --git a/src/xhrInterceptor/responseModifiers/createMessageRemoveParentRef.js b/src/xhrInterceptor/responseModifiers/createMessageRemoveParentRef.js
new file mode 100644
index 0000000..a127975
--- /dev/null
+++ b/src/xhrInterceptor/responseModifiers/createMessageRemoveParentRef.js
@@ -0,0 +1,16 @@
+const createMessageRemoveParentRef = {
+  urlRegex: /api\/CreateMessage/i,
+  featureGated: true,
+  features: ['flattenthreads', 'flattenthreads_switch_enabled'],
+  isEnabled(options) {
+    return options['flattenthreads'] &&
+        options['flattenthreads_switch_enabled'];
+  },
+  async interceptor(_request, response) {
+    // Remove parent_message_id value (field 37)
+    delete response[37];
+    return response;
+  }
+};
+
+export default createMessageRemoveParentRef;