oicq-icalingua-plus-plus 1.22.5 → 1.22.6

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 CHANGED
@@ -962,7 +962,7 @@ export class Client extends EventEmitter {
962
962
  * resid在xml消息中,需要自行解析xml获得
963
963
  * 暂不支持套娃转发解析
964
964
  */
965
- getForwardMsg(resid: string): Promise<Ret<Array<{
965
+ getForwardMsg(resid: string, fileName?: string): Promise<Ret<Array<{
966
966
  group_id?: number,
967
967
  user_id: number,
968
968
  nickname: string,
package/lib/client.js CHANGED
@@ -372,7 +372,7 @@ class Client extends EventEmitter {
372
372
  getChatHistory(message_id, count = 10) {
373
373
  return this._useProtocol(chat.getMsgs, arguments);
374
374
  }
375
- getForwardMsg(id) {
375
+ getForwardMsg(id, fileName = "MultiMsg") {
376
376
  return this._useProtocol(chat.getForwardMsg, arguments);
377
377
  }
378
378
  makeForwardMsg(fakes, dm = false, target = 0) {
@@ -232,8 +232,8 @@ async function getMsgs(message_id, count = 20) {
232
232
  * @param {string} resid
233
233
  * @returns {import("../ref").ProtocolResponse}
234
234
  */
235
- function getForwardMsg(resid) {
236
- return parseForwardMsg.call(this, resid);
235
+ function getForwardMsg(resid, fileName = "MultiMsg") {
236
+ return parseForwardMsg.call(this, resid, fileName);
237
237
  }
238
238
 
239
239
  /**
@@ -737,13 +737,22 @@ async function parseDiscussMsg(msg) {
737
737
  * @param {string} resid
738
738
  * @returns {import("../ref").ProtocolResponse}
739
739
  */
740
- async function parseForwardMsg(resid) {
740
+ async function parseForwardMsg(resid, fileName) {
741
741
  const data = [];
742
742
  const blob = await _downloadMultiMsg.call(this, String(resid), 2);
743
743
  /**
744
744
  * @type {import("../ref").Msg[]}
745
745
  */
746
746
  let msgs = pb.decode(blob)[2];
747
+ if (!Array.isArray(msgs))
748
+ msgs = [msgs];
749
+ for (let msg1 of msgs) {
750
+ const m_fileName = msg1[1].toString();
751
+ if (m_fileName === fileName) {
752
+ msgs = msg1;
753
+ break;
754
+ }
755
+ }
747
756
  if (Array.isArray(msgs))
748
757
  msgs = msgs[0];
749
758
  msgs = msgs[2][1];
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.22.5",
5
- "app_version": "1.22.4",
6
- "upday": "2022/06/04",
4
+ "version": "1.22.6",
5
+ "app_version": "1.22.6",
6
+ "upday": "2022/06/17",
7
7
  "protocol_version": "v11",
8
8
  "description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
9
9
  "main": "index.js",