oicq-icalingua-plus-plus 1.23.7 → 1.23.9
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.d.ts +2 -1
- package/lib/message/builder.js +34 -0
- package/lib/message/chat.js +1 -1
- package/lib/message/face.js +24 -16
- package/lib/message/parser.js +26 -6
- package/package.json +3 -3
package/index.d.ts
CHANGED
package/lib/message/builder.js
CHANGED
|
@@ -243,6 +243,40 @@ class Builder {
|
|
|
243
243
|
id = parseInt(id);
|
|
244
244
|
if (id < 0 || id > 0xffff || isNaN(id))
|
|
245
245
|
return this.c.logger.warn("不正确的表情ID:" + id);
|
|
246
|
+
if (cq.qlottie) {
|
|
247
|
+
if (face.map[id])
|
|
248
|
+
text = face.map[id];
|
|
249
|
+
else if (!text)
|
|
250
|
+
text = "/" + id;
|
|
251
|
+
this.elems2.push([
|
|
252
|
+
{
|
|
253
|
+
53: {
|
|
254
|
+
1: 37,
|
|
255
|
+
2: {
|
|
256
|
+
1: "1",
|
|
257
|
+
2: cq.qlottie,
|
|
258
|
+
3: id,
|
|
259
|
+
4: 1,
|
|
260
|
+
5: 1,
|
|
261
|
+
6: "",
|
|
262
|
+
7: text,
|
|
263
|
+
8: "",
|
|
264
|
+
9: 1
|
|
265
|
+
},
|
|
266
|
+
3: 1
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
1: {
|
|
271
|
+
1: text,
|
|
272
|
+
12: {
|
|
273
|
+
1: "[" + text.slice(1) + "]请使用最新版手机QQ体验新功能"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
]);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
246
280
|
if (id <= 0xff) {
|
|
247
281
|
const old = Buffer.allocUnsafe(2);
|
|
248
282
|
old.writeUInt16BE(0x1441 + id);
|
package/lib/message/chat.js
CHANGED
|
@@ -133,7 +133,7 @@ async function sendJsonMsg(target, json, group, sign) {
|
|
|
133
133
|
const payload = await this.sendOidb("OidbSvc.0xb77_9", pb.encode(body));
|
|
134
134
|
const data = pb.decode(payload);
|
|
135
135
|
if (data[3] !== 0)
|
|
136
|
-
return { result: -1, emsg: data[4] };
|
|
136
|
+
return { result: -1, emsg: data[4].toString() };
|
|
137
137
|
return { result: 0 };
|
|
138
138
|
}
|
|
139
139
|
|
package/lib/message/face.js
CHANGED
|
@@ -252,22 +252,30 @@ const map = {
|
|
|
252
252
|
322: "/拒绝",
|
|
253
253
|
323: "/嫌弃",
|
|
254
254
|
324: "/吃糖",
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
255
|
+
325: "/惊吓",
|
|
256
|
+
326: "/生气",
|
|
257
|
+
327: "/加一",
|
|
258
|
+
328: "/错号",
|
|
259
|
+
329: "/对号",
|
|
260
|
+
330: "/完成",
|
|
261
|
+
331: "/明白",
|
|
262
|
+
332: "/举牌牌",
|
|
263
|
+
333: "/烟花",
|
|
264
|
+
334: "/虎虎生威",
|
|
265
|
+
335: "/绿马护体",
|
|
266
|
+
336: "/豹富",
|
|
267
|
+
337: "/花朵脸",
|
|
268
|
+
338: "/我想开了",
|
|
269
|
+
339: "/舔屏",
|
|
270
|
+
340: "/热化了",
|
|
271
|
+
341: "/打招呼",
|
|
272
|
+
342: "/酸Q",
|
|
273
|
+
343: "/我方了",
|
|
274
|
+
344: "/大怨种",
|
|
275
|
+
345: "/红包多多",
|
|
276
|
+
346: "/你真棒棒",
|
|
277
|
+
347: "/大展宏兔",
|
|
278
|
+
348: "/福萝卜",
|
|
271
279
|
};
|
|
272
280
|
|
|
273
281
|
const FACE_OLD_BUF = Buffer.from([0x00, 0x01, 0x00, 0x04, 0x52, 0xCC, 0xF5, 0xD0]);
|
package/lib/message/parser.js
CHANGED
|
@@ -173,7 +173,7 @@ class Parser {
|
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* 解析排他型消息节点
|
|
176
|
-
* xml, json, ptt, video, flash, file, shake, poke
|
|
176
|
+
* xml, json, ptt, video, flash, file, shake, poke, qlottie
|
|
177
177
|
* @private
|
|
178
178
|
* @param {number} type
|
|
179
179
|
* @param {import("../ref").Proto} elem
|
|
@@ -251,6 +251,15 @@ class Parser {
|
|
|
251
251
|
}
|
|
252
252
|
brief = "[" + msg.data.name + "]";
|
|
253
253
|
break;
|
|
254
|
+
case 37: //qlottie
|
|
255
|
+
msg.type = "face";
|
|
256
|
+
msg.data.id = elem[2][3];
|
|
257
|
+
if (elem[2][2]) msg.data.qlottie = String(elem[2][2]);
|
|
258
|
+
msg.data.text = face.map[msg.data.id];
|
|
259
|
+
if (!msg.data.text)
|
|
260
|
+
msg.data.text = elem[2][7] ? String(elem[2][7]) : ("/" + msg.data.id);
|
|
261
|
+
brief = msg.data.text;
|
|
262
|
+
break;
|
|
254
263
|
default:
|
|
255
264
|
return;
|
|
256
265
|
}
|
|
@@ -401,6 +410,8 @@ class Parser {
|
|
|
401
410
|
this.extra = parser.extra;
|
|
402
411
|
return;
|
|
403
412
|
}
|
|
413
|
+
} else if (type === 9) { //bubble 气泡
|
|
414
|
+
this.bubble_id = elem[1] || 0;
|
|
404
415
|
} else if (!this.exclusive) {
|
|
405
416
|
switch (type) {
|
|
406
417
|
case 1: //text
|
|
@@ -426,14 +437,13 @@ class Parser {
|
|
|
426
437
|
this.parsePartialElem(33, elem[2]);
|
|
427
438
|
} else if (elem[1] === 2) { //poke
|
|
428
439
|
await this.parseExclusiveElem(126, elem);
|
|
440
|
+
} else if (elem[1] === 37) { //qlottie
|
|
441
|
+
await this.parseExclusiveElem(37, elem);
|
|
429
442
|
}
|
|
430
443
|
break;
|
|
431
444
|
case 45: //reply
|
|
432
445
|
await this.parseReplyElem(elem);
|
|
433
446
|
break;
|
|
434
|
-
case 9: //bubble
|
|
435
|
-
this.bubble_id = elem[1];
|
|
436
|
-
break;
|
|
437
447
|
default:
|
|
438
448
|
break;
|
|
439
449
|
}
|
|
@@ -478,10 +488,11 @@ class Parser {
|
|
|
478
488
|
const msg = {
|
|
479
489
|
type: "reply",
|
|
480
490
|
data: {
|
|
481
|
-
id: ""
|
|
491
|
+
id: "",
|
|
492
|
+
text: ""
|
|
482
493
|
}
|
|
483
494
|
};
|
|
484
|
-
let seq = elem[1], user_id = elem[2];
|
|
495
|
+
let seq = elem[1], user_id = elem[2], replyed = Array.isArray(elem[5]) ? elem[5] : [elem[5]];
|
|
485
496
|
if (this.gid) {
|
|
486
497
|
let random = elem[8] ? genRandom(elem[8][3]) : null;
|
|
487
498
|
let time = elem[3];
|
|
@@ -497,6 +508,15 @@ class Parser {
|
|
|
497
508
|
let flag = user_id === this.c.uin ? 1 : 0;
|
|
498
509
|
msg.data.id = genC2CMessageId(this.uid, seq, random, time, flag);
|
|
499
510
|
}
|
|
511
|
+
for (let m of replyed) {
|
|
512
|
+
if (m[1]) {
|
|
513
|
+
msg.data.text += String(m[1][1]);
|
|
514
|
+
} else if (m[2] || m[6] || m[34]) {
|
|
515
|
+
msg.data.text += "[表情]";
|
|
516
|
+
} else if (m[4] || m[8]) {
|
|
517
|
+
msg.data.text += "[图片]";
|
|
518
|
+
}
|
|
519
|
+
}
|
|
500
520
|
this.message.unshift(msg);
|
|
501
521
|
this.raw_message = (this.c.config.brief ? "[回复]" : genCQMsg(msg)) + this.raw_message;
|
|
502
522
|
} catch { }
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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.
|
|
6
|
-
"upday": "2023/01/
|
|
4
|
+
"version": "1.23.9",
|
|
5
|
+
"app_version": "1.23.9",
|
|
6
|
+
"upday": "2023/01/16",
|
|
7
7
|
"protocol_version": "v11",
|
|
8
8
|
"description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
|
|
9
9
|
"main": "index.js",
|