@onyx-p/imlib-web 1.7.8 → 1.8.0

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.
package/index.esm.js CHANGED
@@ -20379,11 +20379,16 @@ const parseMediaAttributeJson = (mediaConstructor, mediaAttribute, msgPostConten
20379
20379
  mediaAttributeJson.content = msgPostContent;
20380
20380
  } else {
20381
20381
  if (mediaAttribute?.length) {
20382
- mediaAttributeJson = JSON.parse(mediaAttribute);
20382
+ const safeJsonString = convertInt64ToString(mediaAttribute);
20383
+ mediaAttributeJson = JSON.parse(safeJsonString);
20383
20384
  }
20384
20385
  }
20385
20386
  return mediaAttributeJson;
20386
20387
  };
20388
+ const convertInt64ToString = jsonString => {
20389
+ const int64Regex = /:\s*(\d{15,})/g;
20390
+ return jsonString.replace(int64Regex, (match, number) => `: "${number}"`);
20391
+ };
20387
20392
  const parseChatRecordMsgDetails$1 = (conversationOpt, msgDetails) => {
20388
20393
  let contentList = [];
20389
20394
  msgDetails.forEach(item => {
@@ -20723,7 +20728,7 @@ class MessageLoader {
20723
20728
  conversationType: notiMsg.conversationType,
20724
20729
  targetId: notiMsg.targetId
20725
20730
  },
20726
- messageUIdList: notiContent.msgIdList
20731
+ messageUIdList: notiContent.msgIdList.map(id => id.toString())
20727
20732
  }, notiMsg.messageType === NotiMessageTypes.GROUP_ARRIVAL_RECEIPT || notiMsg.messageType === NotiMessageTypes.PRIVATE_ARRIVAL_RECEIPT ? 0 : 1);
20728
20733
  });
20729
20734
  return normalMessages;
package/index.umd.js CHANGED
@@ -20385,11 +20385,16 @@
20385
20385
  mediaAttributeJson.content = msgPostContent;
20386
20386
  } else {
20387
20387
  if (mediaAttribute?.length) {
20388
- mediaAttributeJson = JSON.parse(mediaAttribute);
20388
+ const safeJsonString = convertInt64ToString(mediaAttribute);
20389
+ mediaAttributeJson = JSON.parse(safeJsonString);
20389
20390
  }
20390
20391
  }
20391
20392
  return mediaAttributeJson;
20392
20393
  };
20394
+ const convertInt64ToString = jsonString => {
20395
+ const int64Regex = /:\s*(\d{15,})/g;
20396
+ return jsonString.replace(int64Regex, (match, number) => `: "${number}"`);
20397
+ };
20393
20398
  const parseChatRecordMsgDetails$1 = (conversationOpt, msgDetails) => {
20394
20399
  let contentList = [];
20395
20400
  msgDetails.forEach(item => {
@@ -20729,7 +20734,7 @@
20729
20734
  conversationType: notiMsg.conversationType,
20730
20735
  targetId: notiMsg.targetId
20731
20736
  },
20732
- messageUIdList: notiContent.msgIdList
20737
+ messageUIdList: notiContent.msgIdList.map(id => id.toString())
20733
20738
  }, notiMsg.messageType === NotiMessageTypes.GROUP_ARRIVAL_RECEIPT || notiMsg.messageType === NotiMessageTypes.PRIVATE_ARRIVAL_RECEIPT ? 0 : 1);
20734
20739
  });
20735
20740
  return normalMessages;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onyx-p/imlib-web",
3
- "version": "1.7.8",
3
+ "version": "1.8.0",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "types": "types/index.d.ts",