oicq-icalingua-plus-plus 1.23.21 → 1.23.22

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.
@@ -246,12 +246,12 @@ async function makeForwardMsg(iterable, dm = false, target = 0) {
246
246
  });
247
247
  break;
248
248
  case "xml":
249
- elements.push(await buildXmlElem(elem.data.xml, elem.data.svcid));
249
+ elements.push(await buildXmlElem(elem.data.data, elem.data.type));
250
250
  const resIdRegex = /m_resid="([\w+=/]+)"/
251
251
  const fileNameRegex = /m_fileName="([\w+-=/]+)"/
252
- if (resIdRegex.test(elem.data.xml) && fileNameRegex.test(elem.data.xml)) {
253
- const resId = resIdRegex.exec(elem.data.xml)[1];
254
- const fileName = fileNameRegex.exec(elem.data.xml)[1];
252
+ if (resIdRegex.test(elem.data.data) && fileNameRegex.test(elem.data.data)) {
253
+ const resId = resIdRegex.exec(elem.data.data)[1];
254
+ const fileName = fileNameRegex.exec(elem.data.data)[1];
255
255
  const buf = await _downloadMultiMsg.call(this, resId, 2);
256
256
  let msgs = pb.decode(buf)[2];
257
257
  if (!Array.isArray(msgs)) {
@@ -274,8 +274,36 @@ async function makeForwardMsg(iterable, dm = false, target = 0) {
274
274
  }
275
275
  break;
276
276
  case "json":
277
- elements.push(await buildJsonElem(elem.data.json));
278
- brief += "[JSON]";
277
+ elements.push(await buildJsonElem(elem.data.data));
278
+ let jsonObj, resId, fileName
279
+ try {
280
+ jsonObj = JSON.parse(elem.data.data)
281
+ if (jsonObj.app === 'com.tencent.multimsg') {
282
+ resId = jsonObj.meta.detail.resid
283
+ fileName = jsonObj.meta.detail.uniseq
284
+ }
285
+ } catch {}
286
+ if (resId && fileName) {
287
+ const buf = await _downloadMultiMsg.call(this, resId, 2);
288
+ let msgs = pb.decode(buf)[2];
289
+ if (!Array.isArray(msgs)) {
290
+ msgs = [msgs];
291
+ }
292
+ for (let msg of msgs) {
293
+ const m_fileName = msg[1].toString();
294
+ if (m_fileName === 'MultiMsg') {
295
+ Multi.push({
296
+ 1: fileName,
297
+ 2: msg[2]
298
+ });
299
+ } else {
300
+ Multi.push(msg);
301
+ }
302
+ }
303
+ brief += "[聊天记录]";
304
+ } else {
305
+ brief += "[JSON]";
306
+ }
279
307
  break;
280
308
  }
281
309
  }
package/lib/wtlogin/wt.js CHANGED
@@ -177,14 +177,14 @@ class WtLogin {
177
177
  hash = createHash("sha256").update(Buffer.from(inputNum.toString(16), "hex")).digest();
178
178
  cnt++;
179
179
  if (cnt > 1000000) {
180
- this.logger.error("Calc PoW cost too many times, maybe something wrong");
181
- throw new Error("Calc PoW cost too many times, maybe something wrong");
180
+ this.logger.error("Calculating PoW cost too much time, maybe something wrong");
181
+ throw new Error("Calculating PoW cost too much time, maybe something wrong");
182
182
  }
183
183
  }
184
184
  ok = true;
185
- this.logger.info(`Calc PoW cost ${cnt} ms`);
186
185
  dst = Buffer.from(inputNum.toString(16), "hex");
187
186
  elp = Date.now() - start;
187
+ this.logger.info(`Calculating PoW of plus ${cnt} times cost ${elp} ms`);
188
188
  }
189
189
  if (!ok) return Buffer.alloc(0);
190
190
  const body = new Writer()
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.21",
5
- "app_version": "1.23.21",
6
- "upday": "2023/02/23",
4
+ "version": "1.23.22",
5
+ "app_version": "1.23.22",
6
+ "upday": "2023/02/24",
7
7
  "protocol_version": "v11",
8
8
  "description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
9
9
  "main": "index.js",