oicq-icalingua-plus-plus 1.23.76 → 1.23.77
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/lib/message/image.js +8 -7
- package/lib/message/parser.js +41 -9
- package/package.json +2 -2
package/lib/message/image.js
CHANGED
|
@@ -536,14 +536,15 @@ async function uploadImages(target, imgs, c2c = false) {
|
|
|
536
536
|
* 下载QQNT群图
|
|
537
537
|
* @this {import("../ref").Client}
|
|
538
538
|
* @param {number} group_id
|
|
539
|
-
* @param {
|
|
539
|
+
* @param {number} fileid
|
|
540
|
+
* @param {Buffer} fileMd5
|
|
540
541
|
*/
|
|
541
|
-
async function groupNTPicDown(group_id,
|
|
542
|
+
async function groupNTPicDown(group_id, fileid, fileMd5) {
|
|
542
543
|
const req = {
|
|
543
544
|
1: group_id,
|
|
544
545
|
2: this.uin,
|
|
545
|
-
3:
|
|
546
|
-
4:
|
|
546
|
+
3: fileid, //fileid
|
|
547
|
+
4: fileMd5, //fileMd5
|
|
547
548
|
5: 4, //urlFlag
|
|
548
549
|
6: 32, //urlType
|
|
549
550
|
7: 5, //reqTerm
|
|
@@ -567,13 +568,13 @@ async function groupNTPicDown(group_id, elem) {
|
|
|
567
568
|
* 下载QQNT私聊图
|
|
568
569
|
* @this {import("../ref").Client}
|
|
569
570
|
* @param {number} user_id
|
|
570
|
-
* @param {
|
|
571
|
+
* @param {string} fileResId
|
|
571
572
|
*/
|
|
572
|
-
async function offNTPicDown(user_id,
|
|
573
|
+
async function offNTPicDown(user_id, fileResId) {
|
|
573
574
|
const req = {
|
|
574
575
|
1: user_id,
|
|
575
576
|
2: this.uin,
|
|
576
|
-
3:
|
|
577
|
+
3: fileResId, //fileResId
|
|
577
578
|
4: 4, //urlFlag
|
|
578
579
|
6: 32, //urlType
|
|
579
580
|
7: 5, //reqTerm
|
package/lib/message/parser.js
CHANGED
|
@@ -95,6 +95,7 @@ class Parser {
|
|
|
95
95
|
message = [];
|
|
96
96
|
raw_message = "";
|
|
97
97
|
bubble_id = 0;
|
|
98
|
+
imgprefix = null;
|
|
98
99
|
|
|
99
100
|
/**
|
|
100
101
|
* @type {import("../ref").Anonymous}
|
|
@@ -448,6 +449,9 @@ class Parser {
|
|
|
448
449
|
await this.parseExclusiveElem(37, elem);
|
|
449
450
|
} else if (elem[1] === 20) { //json only for mobileqq
|
|
450
451
|
await this.parseExclusiveElem(51, elem[2]);
|
|
452
|
+
} else if (elem[1] == 48) { //image prefix of qqnt
|
|
453
|
+
if (elem[2] && elem[2][1] && elem[2][1][2] && elem[2][1][2][1] && elem[2][1][2][3])
|
|
454
|
+
this.imgprefix = "https://" + String(elem[2][1][2][3]) + String(elem[2][1][2][1]);
|
|
451
455
|
}
|
|
452
456
|
break;
|
|
453
457
|
case 45: //reply
|
|
@@ -467,19 +471,47 @@ class Parser {
|
|
|
467
471
|
*/
|
|
468
472
|
async parseImgElem(elem) {
|
|
469
473
|
const data = { };
|
|
470
|
-
if (
|
|
474
|
+
if (elem[29] && elem[29][30] && String(elem[29][30]).startsWith("&rkey=")) {
|
|
475
|
+
//QQNT 私图
|
|
476
|
+
if (this.imgprefix) {
|
|
477
|
+
data.file = buildImageFileParam(elem[7].toHex(), elem[2], elem[9], elem[8], elem[5]);
|
|
478
|
+
data.url = this.imgprefix + String(elem[29][30]) + "&spec=0";
|
|
479
|
+
this.imgprefix = null;
|
|
480
|
+
return data;
|
|
481
|
+
}
|
|
482
|
+
} else if (elem[34] && elem[34][30] && String(elem[34][30]).startsWith("&rkey=")) {
|
|
483
|
+
//QQNT 群图
|
|
484
|
+
if (this.imgprefix) {
|
|
485
|
+
data.file = buildImageFileParam(elem[13].toHex(), elem[25], elem[22], elem[23], elem[20]);
|
|
486
|
+
data.url = this.imgprefix + String(elem[34][30]) + "&spec=0";
|
|
487
|
+
this.imgprefix = null;
|
|
488
|
+
return data;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if (!elem[7]) { //QQNT 群聊转发到私聊图
|
|
471
492
|
data.file = buildImageFileParam(elem[13].toHex(), elem[25], elem[22], elem[23], elem[20]);
|
|
472
|
-
data.url = await offNTPicDown.call(this.c, this.uid, elem);
|
|
493
|
+
data.url = await offNTPicDown.call(this.c, this.uid, elem[2]);
|
|
473
494
|
} else if (elem[7].toHex) { //私图
|
|
474
495
|
data.file = buildImageFileParam(elem[7].toHex(), elem[2], elem[9], elem[8], elem[5]);
|
|
475
|
-
if (elem[
|
|
476
|
-
data.url = "https://gchat.qpic.cn" + elem[29][30] + "&spec=0&rf=naio";
|
|
477
|
-
else if (elem[15])
|
|
496
|
+
if (elem[15])
|
|
478
497
|
data.url = "https://c2cpicdw.qpic.cn" + elem[15];
|
|
479
|
-
else if (elem[10])
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
498
|
+
else if (elem[10]) {
|
|
499
|
+
if (elem[23])
|
|
500
|
+
data.url = await groupNTPicDown.call(this.c, this.gid, elem[23], elem[7]);
|
|
501
|
+
else
|
|
502
|
+
data.url = await offNTPicDown.call(this.c, this.uid, elem[10]);
|
|
503
|
+
}
|
|
504
|
+
/* deprecated
|
|
505
|
+
if (!data.url || !data.url.includes("offpic_new")) {
|
|
506
|
+
const keys = Object.keys(elem).reverse();
|
|
507
|
+
for (let key of keys) {
|
|
508
|
+
if (elem[key].toString || elem[key].toString().length !== 16) {
|
|
509
|
+
data.url = await offNTPicDown.call(this.c, this.uid, String(elem[key]));
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
*/
|
|
483
515
|
} else { //群图
|
|
484
516
|
data.file = buildImageFileParam(elem[13].toHex(), elem[25], elem[22], elem[23], elem[20]);
|
|
485
517
|
if (elem[16])
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oicq-icalingua-plus-plus",
|
|
3
3
|
"app_name": "oicq-icalingua-plus-plus",
|
|
4
|
-
"version": "1.23.
|
|
5
|
-
"app_version": "1.23.
|
|
4
|
+
"version": "1.23.77",
|
|
5
|
+
"app_version": "1.23.77",
|
|
6
6
|
"upday": "2023/09/22",
|
|
7
7
|
"protocol_version": "v11",
|
|
8
8
|
"description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
|