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,5 +1,31 @@
1
+ import { M } from './toast-a1531088.js';
1
2
  import { S as StencilCore } from './index-bc463197.js';
2
3
 
4
+ /**
5
+ * Flutter `updateConversationNotifications` parity —
6
+ * PATCH /chat/conversation/settings with pushNotifications.
7
+ */
8
+ /** Pure — body shape for ChatSDK.conversation.patchSettings. */
9
+ function buildConversationNotificationsPatch(args) {
10
+ const conversationId = String(args.conversationId || '').trim();
11
+ if (!conversationId) {
12
+ throw new Error('conversationId is required');
13
+ }
14
+ return Object.assign(Object.assign({ conversationId, pushNotifications: args.pushNotifications === true }, (typeof args.typingEvents === 'boolean' ? { typingEvents: args.typingEvents } : {})), (typeof args.readEvents === 'boolean' ? { readEvents: args.readEvents } : {}));
15
+ }
16
+ /** Mute / unmute remote + local push for a conversation (member setting). */
17
+ async function updateConversationNotifications(conversationId, pushNotifications) {
18
+ const body = buildConversationNotificationsPatch({ conversationId, pushNotifications });
19
+ return M.getInstance().Conversation.patchSettings(body);
20
+ }
21
+ /** Merge pushNotifications into a conversation / details object. */
22
+ function withConversationPushFlag(conversation, pushNotifications) {
23
+ if (!conversation || typeof conversation !== 'object')
24
+ return conversation;
25
+ const prevConfig = conversation.config && typeof conversation.config === 'object' ? conversation.config : {};
26
+ return Object.assign(Object.assign({}, conversation), { config: Object.assign(Object.assign({}, prevConfig), { pushNotifications }) });
27
+ }
28
+
3
29
  const appendToMap = (map, refsByValue, propName, value) => {
4
30
  let ref = refsByValue.get(value);
5
31
  if (!ref) {
@@ -304,6 +330,6 @@ const groupMembersStore = {
304
330
  }
305
331
  };
306
332
 
307
- export { createStore as c, groupMembersStore as g };
333
+ export { createStore as c, groupMembersStore as g, updateConversationNotifications as u, withConversationPushFlag as w };
308
334
 
309
- //# sourceMappingURL=group-members-05414da2.js.map
335
+ //# sourceMappingURL=group-members-7909941c.js.map
@@ -0,0 +1 @@
1
+ {"file":"group-members-7909941c.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,CAAO,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,KAAK,QAAQ;QAAE,OAAO,YAAY,CAAC;IAC3E,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AAK,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"],"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}
@@ -7,7 +7,7 @@ import { g as applyThemeObjectToElement, n as normalizeThemeObject, i as initial
7
7
  import { d as drawerDialogService } from './drawer-7de04622.js';
8
8
  import { a as getDeviceID, b as getGroupcastUrlQuery } from './helpers-f33b895c.js';
9
9
  import { M, s as showToast } from './toast-a1531088.js';
10
- import { c as createStore, g as groupMembersStore } from './group-members-05414da2.js';
10
+ import { c as createStore, g as groupMembersStore, w as withConversationPushFlag } from './group-members-7909941c.js';
11
11
  import { d as getGroupcastMessage, r as removeGroupcastMember, e as deleteGroupCast } from './groupcast-cc10c6a4.js';
12
12
  import { t as takeMediaFiles, M as MAX_MEDIA_PER_MESSAGE, j as attachmentBodyForApi, p as prepareMediaAttachments, u as uploadAndPostMediaMessage, k as isAttachmentBodyPlaceholder, f as fetchMessagesPage, s as searchMessages, b as fetchLinkMessages, c as fetchMediaCount, d as fetchMediaAttachments, l as mediaLimitToastMessage, n as buildLocalMediaAttachments, h as customTypeFromMime, A as ATTACHMENT_BODY_PLACEHOLDER, i as buildReplyMetaData, m as markConversationRead } from './send-media-5527ee9f.js';
13
13
  import { f as findConversationForPush, s as showLocalMessageNotification, m as messagePushContextFrom, w as withHostMessagePushFields } from './local-notification-4c1e166d.js';
@@ -944,8 +944,8 @@ async function dispatchMqttMessage(parsedMessage, ctx) {
944
944
  }
945
945
  // Local inbound alert (host can disable / customize via init props).
946
946
  const conversation = findConversationForPush(parsedMessage.conversationId, ctx.allConversationList, ctx.conversationMetaData);
947
- const pushMuted = ((_10 = conversation === null || conversation === void 0 ? void 0 : conversation.config) === null || _10 === void 0 ? void 0 : _10.pushNotifications) === false;
948
- if (!pushMuted && ((_11 = parsedMessage === null || parsedMessage === void 0 ? void 0 : parsedMessage.events) === null || _11 === void 0 ? void 0 : _11.sendPushNotification) !== false) {
947
+ const conversationPushEnabled = ((_10 = conversation === null || conversation === void 0 ? void 0 : conversation.config) === null || _10 === void 0 ? void 0 : _10.pushNotifications) !== false;
948
+ if (conversationPushEnabled && ((_11 = parsedMessage === null || parsedMessage === void 0 ? void 0 : parsedMessage.events) === null || _11 === void 0 ? void 0 : _11.sendPushNotification) !== false) {
949
949
  showLocalMessageNotification(parsedMessage, {
950
950
  pushCtx: messagePushContextFrom({
951
951
  userMetaData: {
@@ -953,7 +953,7 @@ async function dispatchMqttMessage(parsedMessage, ctx) {
953
953
  },
954
954
  conversation,
955
955
  }),
956
- conversationPushEnabled: true,
956
+ conversationPushEnabled,
957
957
  });
958
958
  }
959
959
  }
@@ -2387,18 +2387,31 @@ function hostContactAction(host, event) {
2387
2387
  }
2388
2388
  async function hostConversationUpdate(host, event) {
2389
2389
  const { conversationId, type, value } = event.detail || {};
2390
+ const settingsPush = type === 'settings' && typeof (value === null || value === void 0 ? void 0 : value.pushNotifications) === 'boolean'
2391
+ ? value.pushNotifications === true
2392
+ : null;
2390
2393
  if (type === 'title' && value) {
2391
2394
  host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), { conversationTitle: value }) : conv);
2392
2395
  }
2393
2396
  else if (type === 'image' && value) {
2394
2397
  host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), { conversationImageUrl: value }) : conv);
2395
2398
  }
2399
+ else if (settingsPush !== null) {
2400
+ // Optimistic — MQTT local alerts read list/meta config, not contact-info state alone.
2401
+ host.allConversationList = (host.allConversationList || []).map((conv) => conv.conversationId === conversationId
2402
+ ? withConversationPushFlag(conv, settingsPush)
2403
+ : conv);
2404
+ if (host.selectedConversationId === conversationId && host.conversationMetaData) {
2405
+ host.conversationMetaData = withConversationPushFlag(host.conversationMetaData, settingsPush);
2406
+ }
2407
+ }
2396
2408
  try {
2397
2409
  const response = await M.getInstance().Conversation.getConversationDetails(conversationId, 'true');
2398
2410
  if (response) {
2399
- host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), response) : conv);
2411
+ const merged = settingsPush !== null ? withConversationPushFlag(response, settingsPush) : response;
2412
+ host.allConversationList = host.allConversationList.map((conv) => conv.conversationId === conversationId ? Object.assign(Object.assign({}, conv), merged) : conv);
2400
2413
  if (host.selectedConversationId === conversationId) {
2401
- host.conversationMetaData = response;
2414
+ host.conversationMetaData = merged;
2402
2415
  }
2403
2416
  }
2404
2417
  }