@onyx-p/imlib-web 1.8.0 → 1.8.1
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 +2 -9
- package/index.umd.js +2 -9
- package/package.json +1 -1
package/index.esm.js
CHANGED
@@ -20364,9 +20364,6 @@ const decodeMessageContent = (dialogMessage, aesKey) => {
|
|
20364
20364
|
if (dialogMessage.msgPostContent?.length) {
|
20365
20365
|
msgPostContent = aes256Decrypt(dialogMessage.msgPostContent, aesKey);
|
20366
20366
|
}
|
20367
|
-
if (dialogMessage.mediaConstructor === 0x60010012 || dialogMessage.mediaConstructor === 0x60020021) {
|
20368
|
-
mediaAttribute = transMsgIdNum64ToString(mediaAttribute);
|
20369
|
-
}
|
20370
20367
|
return parseMediaAttributeJson(dialogMessage.mediaConstructor, mediaAttribute, msgPostContent);
|
20371
20368
|
} catch (error) {
|
20372
20369
|
logger.error('decode message content fail -> uid:', dialogMessage.msgId.toString());
|
@@ -20386,8 +20383,8 @@ const parseMediaAttributeJson = (mediaConstructor, mediaAttribute, msgPostConten
|
|
20386
20383
|
return mediaAttributeJson;
|
20387
20384
|
};
|
20388
20385
|
const convertInt64ToString = jsonString => {
|
20389
|
-
const int64Regex =
|
20390
|
-
return jsonString.replace(int64Regex,
|
20386
|
+
const int64Regex = /(?<!")\b(\d{15,})\b(?!")/g;
|
20387
|
+
return jsonString.replace(int64Regex, '"$1"');
|
20391
20388
|
};
|
20392
20389
|
const parseChatRecordMsgDetails$1 = (conversationOpt, msgDetails) => {
|
20393
20390
|
let contentList = [];
|
@@ -20420,10 +20417,6 @@ const parseChatRecordMsgDetails$1 = (conversationOpt, msgDetails) => {
|
|
20420
20417
|
});
|
20421
20418
|
return contentList;
|
20422
20419
|
};
|
20423
|
-
const transMsgIdNum64ToString = jsonString => {
|
20424
|
-
const reg = /("msgId")\s*:\s*(\d+)/g;
|
20425
|
-
return jsonString.replace(reg, (r1, r2, r3) => `${r2}:"${r3}"`);
|
20426
|
-
};
|
20427
20420
|
var serverMessageParser = {
|
20428
20421
|
parse,
|
20429
20422
|
parseSingleDialogMessages,
|
package/index.umd.js
CHANGED
@@ -20370,9 +20370,6 @@
|
|
20370
20370
|
if (dialogMessage.msgPostContent?.length) {
|
20371
20371
|
msgPostContent = aes256Decrypt(dialogMessage.msgPostContent, aesKey);
|
20372
20372
|
}
|
20373
|
-
if (dialogMessage.mediaConstructor === 0x60010012 || dialogMessage.mediaConstructor === 0x60020021) {
|
20374
|
-
mediaAttribute = transMsgIdNum64ToString(mediaAttribute);
|
20375
|
-
}
|
20376
20373
|
return parseMediaAttributeJson(dialogMessage.mediaConstructor, mediaAttribute, msgPostContent);
|
20377
20374
|
} catch (error) {
|
20378
20375
|
logger.error('decode message content fail -> uid:', dialogMessage.msgId.toString());
|
@@ -20392,8 +20389,8 @@
|
|
20392
20389
|
return mediaAttributeJson;
|
20393
20390
|
};
|
20394
20391
|
const convertInt64ToString = jsonString => {
|
20395
|
-
const int64Regex =
|
20396
|
-
return jsonString.replace(int64Regex,
|
20392
|
+
const int64Regex = /(?<!")\b(\d{15,})\b(?!")/g;
|
20393
|
+
return jsonString.replace(int64Regex, '"$1"');
|
20397
20394
|
};
|
20398
20395
|
const parseChatRecordMsgDetails$1 = (conversationOpt, msgDetails) => {
|
20399
20396
|
let contentList = [];
|
@@ -20426,10 +20423,6 @@
|
|
20426
20423
|
});
|
20427
20424
|
return contentList;
|
20428
20425
|
};
|
20429
|
-
const transMsgIdNum64ToString = jsonString => {
|
20430
|
-
const reg = /("msgId")\s*:\s*(\d+)/g;
|
20431
|
-
return jsonString.replace(reg, (r1, r2, r3) => `${r2}:"${r3}"`);
|
20432
|
-
};
|
20433
20426
|
var serverMessageParser = {
|
20434
20427
|
parse,
|
20435
20428
|
parseSingleDialogMessages,
|