isometrik-plugin-chat-sdk 2.0.17 → 2.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/attachment-preview_22.cjs.entry.js +7 -32
  2. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{group-members-5a82ec8a.js → group-members-cef1198e.js} +29 -1
  4. package/dist/cjs/group-members-cef1198e.js.map +1 -0
  5. package/dist/cjs/login-page_3.cjs.entry.js +19 -6
  6. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +4 -4
  8. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
  9. package/dist/collection/components/my-component/web-chat/event-handlers.js +16 -3
  10. package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
  11. package/dist/collection/lib/mqtt/dispatch.js +3 -3
  12. package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
  13. package/dist/components/WebChat.js +19 -6
  14. package/dist/components/WebChat.js.map +1 -1
  15. package/dist/components/contact-info2.js +5 -5
  16. package/dist/components/contact-info2.js.map +1 -1
  17. package/dist/esm/attachment-preview_22.entry.js +5 -30
  18. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  19. package/dist/esm/{group-members-05414da2.js → group-members-7909941c.js} +28 -2
  20. package/dist/esm/group-members-7909941c.js.map +1 -0
  21. package/dist/esm/login-page_3.entry.js +19 -6
  22. package/dist/esm/login-page_3.entry.js.map +1 -1
  23. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  24. package/dist/isometrik-webchat/p-5cfb953d.js +2 -0
  25. package/dist/isometrik-webchat/p-5cfb953d.js.map +1 -0
  26. package/dist/isometrik-webchat/p-a9380fb3.entry.js +2 -0
  27. package/dist/isometrik-webchat/{p-e5ffe038.entry.js.map → p-a9380fb3.entry.js.map} +1 -1
  28. package/dist/isometrik-webchat/p-ceb08a13.entry.js +2 -0
  29. package/dist/isometrik-webchat/p-ceb08a13.entry.js.map +1 -0
  30. package/package.json +1 -1
  31. package/dist/cjs/group-members-5a82ec8a.js.map +0 -1
  32. package/dist/esm/group-members-05414da2.js.map +0 -1
  33. package/dist/isometrik-webchat/p-b667a9fc.js +0 -2
  34. package/dist/isometrik-webchat/p-b667a9fc.js.map +0 -1
  35. package/dist/isometrik-webchat/p-bf71ce5e.entry.js +0 -2
  36. package/dist/isometrik-webchat/p-bf71ce5e.entry.js.map +0 -1
  37. package/dist/isometrik-webchat/p-e5ffe038.entry.js +0 -2
@@ -1,7 +1,33 @@
1
1
  'use strict';
2
2
 
3
+ const toast = require('./toast-91093c84.js');
3
4
  const index = require('./index-f624fc47.js');
4
5
 
6
+ /**
7
+ * Flutter `updateConversationNotifications` parity —
8
+ * PATCH /chat/conversation/settings with pushNotifications.
9
+ */
10
+ /** Pure — body shape for ChatSDK.conversation.patchSettings. */
11
+ function buildConversationNotificationsPatch(args) {
12
+ const conversationId = String(args.conversationId || '').trim();
13
+ if (!conversationId) {
14
+ throw new Error('conversationId is required');
15
+ }
16
+ return Object.assign(Object.assign({ conversationId, pushNotifications: args.pushNotifications === true }, (typeof args.typingEvents === 'boolean' ? { typingEvents: args.typingEvents } : {})), (typeof args.readEvents === 'boolean' ? { readEvents: args.readEvents } : {}));
17
+ }
18
+ /** Mute / unmute remote + local push for a conversation (member setting). */
19
+ async function updateConversationNotifications(conversationId, pushNotifications) {
20
+ const body = buildConversationNotificationsPatch({ conversationId, pushNotifications });
21
+ return toast.M.getInstance().Conversation.patchSettings(body);
22
+ }
23
+ /** Merge pushNotifications into a conversation / details object. */
24
+ function withConversationPushFlag(conversation, pushNotifications) {
25
+ if (!conversation || typeof conversation !== 'object')
26
+ return conversation;
27
+ const prevConfig = conversation.config && typeof conversation.config === 'object' ? conversation.config : {};
28
+ return Object.assign(Object.assign({}, conversation), { config: Object.assign(Object.assign({}, prevConfig), { pushNotifications }) });
29
+ }
30
+
5
31
  const appendToMap = (map, refsByValue, propName, value) => {
6
32
  let ref = refsByValue.get(value);
7
33
  if (!ref) {
@@ -308,5 +334,7 @@ const groupMembersStore = {
308
334
 
309
335
  exports.createStore = createStore;
310
336
  exports.groupMembersStore = groupMembersStore;
337
+ exports.updateConversationNotifications = updateConversationNotifications;
338
+ exports.withConversationPushFlag = withConversationPushFlag;
311
339
 
312
- //# sourceMappingURL=group-members-5a82ec8a.js.map
340
+ //# sourceMappingURL=group-members-cef1198e.js.map
@@ -0,0 +1 @@
1
+ {"file":"group-members-cef1198e.js","mappings":";;;;;AAAA;;;;AAaA;SACgB,mCAAmC,CACjD,IAAoC;IAEpC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAChE,IAAI,CAAC,cAAc,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;KAC/C;IACD,qCACE,cAAc,EACd,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,KAAK,IAAI,KAC9C,OAAO,IAAI,CAAC,YAAY,KAAK,SAAS,GAAG,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,KACjF,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,GAC/E;AACJ,CAAC;AAED;AACO,eAAe,+BAA+B,CACnD,cAAsB,EACtB,iBAA0B;IAE1B,MAAM,IAAI,GAAG,mCAAmC,CAAC,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACxF,OAAOA,OAAO,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC;AAED;SACgB,wBAAwB,CACtC,YAAe,EACf,iBAA0B;IAE1B,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY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AI,IAAI,KAAK,IAAI,CAAC,EAAE;AACpB,QAAQ,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC/C,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;AACvB,KAAK;AACL,CAAC,CAAC;AACF;AACK,MAAC,WAAW,GAAG,CAAC,YAAY,EAAE,YAAY,KAAK;AACpD,IAAI,MAAM,GAAG,GAAG,mBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AAChE,IAAI,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC,CAAC;AACnC,IAAI,OAAO,GAAG,CAAC;AACf;;AC3QA,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAoB;IAC/C,OAAO,EAAE,EAAE;IACX,qBAAqB,EAAE,IAAI;CAC5B,CAAC,CAAC;MAEU,iBAAiB,GAAG;IAC/B,KAAK;IAEL,iBAAiB,CAAC,OAAsB,EAAE,cAAsB;QAC9D,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,KAAK,CAAC,qBAAqB,GAAG,cAAc,CAAC;KAC9C;IAED,iBAAiB,CAAC,MAAc,EAAE,OAAgB;QAChD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM;YACtC,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,mCAAQ,MAAM,KAAE,OAAO,MAAK,MAAM,CAAC;SACnE,CAAC,CAAC;KACJ;IAED,UAAU;QACR,OAAO,KAAK,CAAC,OAAO,CAAC;KACtB;IAED,wBAAwB;QACtB,OAAO,KAAK,CAAC,qBAAqB,CAAC;KACpC;;;;;;;;","names":["ChatSDK","StencilCore"],"sources":["src/lib/chat/conversation-notifications.ts","node_modules/@stencil/store/dist/index.js","src/store/group-members.ts"],"sourcesContent":["/**\n * Flutter `updateConversationNotifications` parity —\n * PATCH /chat/conversation/settings with pushNotifications.\n */\nimport ChatSDK from 'test-iso-chat-sdk';\n\nexport type ConversationNotificationsPatch = {\n conversationId: string;\n pushNotifications: boolean;\n typingEvents?: boolean;\n readEvents?: boolean;\n};\n\n/** Pure — body shape for ChatSDK.conversation.patchSettings. */\nexport function buildConversationNotificationsPatch(\n args: ConversationNotificationsPatch,\n): ConversationNotificationsPatch {\n const conversationId = String(args.conversationId || '').trim();\n if (!conversationId) {\n throw new Error('conversationId is required');\n }\n return {\n conversationId,\n pushNotifications: args.pushNotifications === true,\n ...(typeof args.typingEvents === 'boolean' ? { typingEvents: args.typingEvents } : {}),\n ...(typeof args.readEvents === 'boolean' ? { readEvents: args.readEvents } : {}),\n };\n}\n\n/** Mute / unmute remote + local push for a conversation (member setting). */\nexport async function updateConversationNotifications(\n conversationId: string,\n pushNotifications: boolean,\n): Promise<unknown> {\n const body = buildConversationNotificationsPatch({ conversationId, pushNotifications });\n return ChatSDK.getInstance().Conversation.patchSettings(body);\n}\n\n/** Merge pushNotifications into a conversation / details object. */\nexport function withConversationPushFlag<T extends Record<string, any>>(\n conversation: T,\n pushNotifications: boolean,\n): T {\n if (!conversation || typeof conversation !== 'object') return conversation;\n const prevConfig =\n conversation.config && typeof conversation.config === 'object' ? conversation.config : {};\n return {\n ...conversation,\n config: {\n ...prevConfig,\n pushNotifications,\n },\n };\n}\n","import * as StencilCore from '@stencil/core';\n\nconst appendToMap = (map, refsByValue, propName, value) => {\n let ref = refsByValue.get(value);\n if (!ref) {\n ref = new WeakRef(value);\n refsByValue.set(value, ref);\n }\n let refs = map.get(propName);\n if (!refs) {\n refs = new Set();\n map.set(propName, refs);\n }\n refs.add(ref);\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n map.forEach((refs, key) => {\n const nextRefs = new Set();\n refs.forEach((ref) => {\n const elm = ref.deref();\n if (elm && isConnected(elm))\n nextRefs.add(ref);\n });\n map.set(key, nextRefs);\n });\n}, 2_000);\nconst core = StencilCore;\nconst forceUpdate = core.forceUpdate;\nconst getRenderingRef = core.getRenderingRef;\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function' || typeof forceUpdate !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const ensureForceUpdate = forceUpdate;\n const ensureGetRenderingRef = getRenderingRef;\n const refsByElement = new WeakMap();\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = ensureGetRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, refsByElement, propName, elm);\n }\n },\n set: (propName) => {\n const refs = elmsToUpdate.get(propName);\n if (refs) {\n const nextRefs = new Set();\n refs.forEach((ref) => {\n const elm = ref.deref();\n if (elm && ensureForceUpdate(elm))\n nextRefs.add(ref);\n });\n elmsToUpdate.set(propName, nextRefs);\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((refs) => {\n refs.forEach((ref) => {\n const elm = ref.deref();\n if (elm)\n ensureForceUpdate(elm);\n });\n });\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const resolveDefaultState = () => (unwrap(defaultState) ?? {});\n const initialState = resolveDefaultState();\n let states = new Map(Object.entries(initialState));\n const proxyAvailable = typeof Proxy !== 'undefined';\n const plainState = proxyAvailable ? null : {};\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n // Track onChange listeners to enable removeListener functionality\n const changeListeners = new Map();\n const reset = () => {\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries(resolveDefaultState()));\n if (!proxyAvailable) {\n syncPlainStateKeys();\n }\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n if (!proxyAvailable) {\n ensurePlainProperty(propName);\n }\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (proxyAvailable\n ? new Proxy(initialState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n })\n : (() => {\n syncPlainStateKeys();\n return plainState;\n })());\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const setHandler = (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n };\n const resetHandler = () => {\n const snapshot = resolveDefaultState();\n cb(snapshot[propName]);\n };\n // Register the handlers\n const unSet = on('set', setHandler);\n const unReset = on('reset', resetHandler);\n // Track the relationship between the user callback and internal handlers\n changeListeners.set(cb, { setHandler, resetHandler, propName });\n return () => {\n unSet();\n unReset();\n changeListeners.delete(cb);\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n const removeListener = (propName, listener) => {\n const listenerInfo = changeListeners.get(listener);\n if (listenerInfo && listenerInfo.propName === propName) {\n // Remove the specific handlers that were created for this listener\n removeFromArray(handlers.set, listenerInfo.setHandler);\n removeFromArray(handlers.reset, listenerInfo.resetHandler);\n changeListeners.delete(listener);\n }\n };\n function ensurePlainProperty(key) {\n if (proxyAvailable || !plainState) {\n return;\n }\n if (Object.prototype.hasOwnProperty.call(plainState, key)) {\n return;\n }\n Object.defineProperty(plainState, key, {\n configurable: true,\n enumerable: true,\n get() {\n return get(key);\n },\n set(value) {\n set(key, value);\n },\n });\n }\n function syncPlainStateKeys() {\n if (proxyAvailable || !plainState) {\n return;\n }\n const knownKeys = new Set(states.keys());\n for (const key of Object.keys(plainState)) {\n if (!knownKeys.has(key)) {\n delete plainState[key];\n }\n }\n for (const key of knownKeys) {\n ensurePlainProperty(key);\n }\n }\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n removeListener,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","import { createStore } from \"@stencil/store\";\n\ninterface GroupMember {\n userId: string;\n userName: string;\n userProfileImageUrl: string;\n isAdmin: boolean;\n}\n\ninterface GroupMembersState {\n members: GroupMember[];\n currentConversationId: string | null;\n}\n\nconst { state } = createStore<GroupMembersState>({\n members: [],\n currentConversationId: null\n});\n\nexport const groupMembersStore = {\n state,\n\n initializeMembers(members: GroupMember[], conversationId: string) {\n state.members = members;\n state.currentConversationId = conversationId;\n },\n\n updateAdminStatus(userId: string, isAdmin: boolean) {\n state.members = state.members.map(member => {\n return member.userId === userId ? { ...member, isAdmin } : member;\n });\n },\n\n getMembers() {\n return state.members;\n },\n\n getCurrentConversationId() {\n return state.currentConversationId;\n }\n};"],"version":3}
@@ -11,7 +11,7 @@ const groupcast = require('./groupcast-4239cbfc.js');
11
11
  const drawer = require('./drawer-00a2323a.js');
12
12
  const helpers = require('./helpers-154861e9.js');
13
13
  const toast = require('./toast-91093c84.js');
14
- const groupMembers = require('./group-members-5a82ec8a.js');
14
+ const groupMembers = require('./group-members-cef1198e.js');
15
15
  const groupcast$1 = require('./groupcast-3cb44a25.js');
16
16
  const sendMedia = require('./send-media-7c865c19.js');
17
17
  const localNotification = require('./local-notification-bdd04d7a.js');
@@ -948,8 +948,8 @@ async function dispatchMqttMessage(parsedMessage, ctx) {
948
948
  }
949
949
  // Local inbound alert (host can disable / customize via init props).
950
950
  const conversation = localNotification.findConversationForPush(parsedMessage.conversationId, ctx.allConversationList, ctx.conversationMetaData);
951
- const pushMuted = ((_10 = conversation === null || conversation === void 0 ? void 0 : conversation.config) === null || _10 === void 0 ? void 0 : _10.pushNotifications) === false;
952
- if (!pushMuted && ((_11 = parsedMessage === null || parsedMessage === void 0 ? void 0 : parsedMessage.events) === null || _11 === void 0 ? void 0 : _11.sendPushNotification) !== false) {
951
+ const conversationPushEnabled = ((_10 = conversation === null || conversation === void 0 ? void 0 : conversation.config) === null || _10 === void 0 ? void 0 : _10.pushNotifications) !== false;
952
+ if (conversationPushEnabled && ((_11 = parsedMessage === null || parsedMessage === void 0 ? void 0 : parsedMessage.events) === null || _11 === void 0 ? void 0 : _11.sendPushNotification) !== false) {
953
953
  localNotification.showLocalMessageNotification(parsedMessage, {
954
954
  pushCtx: localNotification.messagePushContextFrom({
955
955
  userMetaData: {
@@ -957,7 +957,7 @@ async function dispatchMqttMessage(parsedMessage, ctx) {
957
957
  },
958
958
  conversation,
959
959
  }),
960
- conversationPushEnabled: true,
960
+ conversationPushEnabled,
961
961
  });
962
962
  }
963
963
  }
@@ -2391,18 +2391,31 @@ function hostContactAction(host, event) {
2391
2391
  }
2392
2392
  async function hostConversationUpdate(host, event) {
2393
2393
  const { conversationId, type, value } = event.detail || {};
2394
+ const settingsPush = type === 'settings' && typeof (value === null || value === void 0 ? void 0 : value.pushNotifications) === 'boolean'
2395
+ ? value.pushNotifications === true
2396
+ : null;
2394
2397
  if (type === 'title' && value) {
2395
2398
  host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), { conversationTitle: value }) : conv);
2396
2399
  }
2397
2400
  else if (type === 'image' && value) {
2398
2401
  host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), { conversationImageUrl: value }) : conv);
2399
2402
  }
2403
+ else if (settingsPush !== null) {
2404
+ // Optimistic — MQTT local alerts read list/meta config, not contact-info state alone.
2405
+ host.allConversationList = (host.allConversationList || []).map((conv) => conv.conversationId === conversationId
2406
+ ? groupMembers.withConversationPushFlag(conv, settingsPush)
2407
+ : conv);
2408
+ if (host.selectedConversationId === conversationId && host.conversationMetaData) {
2409
+ host.conversationMetaData = groupMembers.withConversationPushFlag(host.conversationMetaData, settingsPush);
2410
+ }
2411
+ }
2400
2412
  try {
2401
2413
  const response = await toast.M.getInstance().Conversation.getConversationDetails(conversationId, 'true');
2402
2414
  if (response) {
2403
- host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), response) : conv);
2415
+ const merged = settingsPush !== null ? groupMembers.withConversationPushFlag(response, settingsPush) : response;
2416
+ host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), merged) : conv);
2404
2417
  if (host.selectedConversationId === conversationId) {
2405
- host.conversationMetaData = response;
2418
+ host.conversationMetaData = merged;
2406
2419
  }
2407
2420
  }
2408
2421
  }