Files
NapCatQQ/src/core.lib/src/apis/msg.js
T
2024-06-08 22:13:05 +08:00

1 line
9.6 KiB
JavaScript

const _0x5ef461=_0x1e1c;(function(_0x25c8c3,_0x3e58ad){const _0x32a64a=_0x1e1c,_0x3bae18=_0x25c8c3();while(!![]){try{const _0x123fc6=parseInt(_0x32a64a(0x110))/0x1+parseInt(_0x32a64a(0xef))/0x2+parseInt(_0x32a64a(0xf6))/0x3*(-parseInt(_0x32a64a(0x119))/0x4)+-parseInt(_0x32a64a(0xee))/0x5*(parseInt(_0x32a64a(0xe9))/0x6)+-parseInt(_0x32a64a(0x11a))/0x7*(-parseInt(_0x32a64a(0xf0))/0x8)+-parseInt(_0x32a64a(0xf4))/0x9+-parseInt(_0x32a64a(0xfb))/0xa*(-parseInt(_0x32a64a(0xdf))/0xb);if(_0x123fc6===_0x3e58ad)break;else _0x3bae18['push'](_0x3bae18['shift']());}catch(_0x55ebf4){_0x3bae18['push'](_0x3bae18['shift']());}}}(_0x2cd0,0x55add));import{selfInfo}from'@/core/data';import{log,logError}from'@/common/utils/log';import{sleep}from'@/common/utils/helper';function _0x1e1c(_0x52db58,_0x52b146){const _0x2cd041=_0x2cd0();return _0x1e1c=function(_0x1e1cf3,_0x3eb39a){_0x1e1cf3=_0x1e1cf3-0xda;let _0x3bed63=_0x2cd041[_0x1e1cf3];return _0x3bed63;},_0x1e1c(_0x52db58,_0x52b146);}import{napCatCore}from'@/core';import{MsgListener}from'@/core/listeners';import{randomUUID}from'crypto';const sendMessagePool={},sendSuccessCBMap={},GroupFileInfoUpdateTasks=new Map(),sentMsgTasks=new Map(),msgListener=new MsgListener();msgListener[_0x5ef461(0x112)]=_0x278971=>{const _0x3c8011={'DVSxZ':function(_0x59a33a,_0x5c165f){return _0x59a33a(_0x5c165f);}};for(const [_0x550a87,_0x18fb18]of GroupFileInfoUpdateTasks){_0x3c8011['DVSxZ'](_0x18fb18,_0x278971),GroupFileInfoUpdateTasks['delete'](_0x550a87);}},msgListener[_0x5ef461(0x10d)]=_0x2bbb09=>{const _0x549518=_0x5ef461,_0x229afa={'dAZYw':function(_0x8421cd,_0x2ddde3){return _0x8421cd(_0x2ddde3);},'YmrNW':function(_0x511431,_0x5e7b65){return _0x511431 instanceof _0x5e7b65;}};for(const [_0x9895a0,_0x1423e7]of sentMsgTasks){_0x229afa[_0x549518(0xde)](_0x1423e7,_0x2bbb09),sentMsgTasks['delete'](_0x9895a0);}if(sendMessagePool[_0x2bbb09[_0x549518(0x101)]]){const _0x4b0512=sendMessagePool[_0x2bbb09[_0x549518(0x101)]]?.(_0x2bbb09);_0x229afa[_0x549518(0x10a)](_0x4b0512,Promise)&&_0x4b0512[_0x549518(0xf2)]()[_0x549518(0x111)](logError);}},msgListener[_0x5ef461(0xf3)]=_0x4472b1=>{const _0x47c937={'FRaWd':function(_0xddd3a1,_0x31670a){return _0xddd3a1(_0x31670a);},'ZnEbx':function(_0xa8a83c,_0x58688b){return _0xa8a83c instanceof _0x58688b;}};_0x4472b1['forEach'](_0x1d7b70=>{const _0x61bcd6=_0x1e1c;new Promise((_0x18b49e,_0x166844)=>{const _0x5f4c6e=_0x1e1c;for(const _0x5e7f9f in sendSuccessCBMap){const _0x1d28ff=sendSuccessCBMap[_0x5e7f9f],_0x44d170=_0x47c937[_0x5f4c6e(0x116)](_0x1d28ff,_0x1d7b70),_0x45c693=_0x11edaf=>{_0x11edaf&&delete sendSuccessCBMap[_0x5e7f9f];};_0x47c937[_0x5f4c6e(0x10c)](_0x44d170,Promise)?_0x44d170[_0x5f4c6e(0xf2)](_0x45c693):_0x45c693(_0x44d170);}})[_0x61bcd6(0xf2)]()[_0x61bcd6(0x111)](log);});},setTimeout(()=>{const _0x10a331=_0x5ef461;napCatCore[_0x10a331(0xe5)](()=>{const _0x2dfd70=_0x10a331;napCatCore[_0x2dfd70(0x10f)](msgListener);});},0x64);function _0x2cd0(){const _0x1d6e75=['egkiW','msgId','CSwqs','aLPmy','75TZzWPZ','92874anHjCh','167576ARwCOp','map','then','onMsgInfoListUpdate','4705614ZrTCTm','XkSAz','3wjCutr','sendStatus','item','app','mDytH','5790pdVdpV','RicWG','getMsgService','getMsgHistory','activateChat','set','peerUid','sendMsg','senderUid','chatType','parse','getMsgsByMsgId','mvGIQ','recallMsg','uid','YmrNW','fetchRecentContact','ZnEbx','onAddSendMsg','VlxqA','addListener','98896uqsgDG','catch','onGroupFileInfoUpdate','session','getRichMediaService','setMsgRead','FRaWd','GKwHw','转发消息超时','1424892jewzzl','21ziLNtV','获取群文件列表超时','pilLW','setEmojiLike','getMsgsBySeqAndCount','elements','arkElement','getMultiMsg','dAZYw','26939mmXlrH','UFcXt','UvIyj','com.tencent.multimsg','multiForwardMsg','multiForwardMsgWithComment','onLoginSuccess','getGroupFileList','find','GVLOK','158454tKXBQI'];_0x2cd0=function(){return _0x1d6e75;};return _0x2cd0();}export class NTQQMsgApi{static async[_0x5ef461(0x11d)](_0x52beee,_0x2105aa,_0x2d332e,_0x4b03ff=!![]){const _0x5b72c2=_0x5ef461;return _0x2d332e=_0x2d332e['toString'](),napCatCore[_0x5b72c2(0x113)]['getMsgService']()['setMsgEmojiLikes'](_0x52beee,_0x2105aa,_0x2d332e,_0x2d332e['length']>0x3?'2':'1',_0x4b03ff);}static async[_0x5ef461(0xdd)](_0x5cdc08,_0x5b76fc,_0x2018ca){const _0x1a27dd=_0x5ef461;return napCatCore[_0x1a27dd(0x113)][_0x1a27dd(0xfd)]()['getMultiMsg'](_0x5cdc08,_0x5b76fc,_0x2018ca);}static async[_0x5ef461(0x106)](_0x61caa6,_0x5e6a15){const _0x5f5b14=_0x5ef461;return await napCatCore[_0x5f5b14(0x113)][_0x5f5b14(0xfd)]()['getMsgsByMsgId'](_0x61caa6,_0x5e6a15);}static async['getMsgsBySeqAndCount'](_0x26bdcd,_0x5b09b8,_0x40830e,_0x5d3c1c,_0x388fc2){const _0x41553b=_0x5ef461;return await napCatCore[_0x41553b(0x113)][_0x41553b(0xfd)]()[_0x41553b(0xda)](_0x26bdcd,_0x5b09b8,_0x40830e,_0x5d3c1c,_0x388fc2);}static async[_0x5ef461(0xff)](_0x41f51c){}static async['activateChatAndGetHistory'](_0x38dc06){}static async[_0x5ef461(0x115)](_0x4680bc){const _0x26f833=_0x5ef461;return napCatCore[_0x26f833(0x113)]['getMsgService']()['setMsgRead'](_0x4680bc);}static async[_0x5ef461(0xe6)](_0x4f3673,_0x4de54d){const _0x563606={'pilLW':function(_0x58bb06,_0x825c58,_0x23546e){return _0x58bb06(_0x825c58,_0x23546e);},'CSwqs':function(_0x388735){return _0x388735();}};return new Promise(async(_0x1f9b63,_0x570a4e)=>{const _0x22acb3=_0x1e1c;let _0x13ee2d=![];_0x563606[_0x22acb3(0x11c)](setTimeout,()=>{const _0x587512=_0x22acb3;!_0x13ee2d&&_0x570a4e(_0x587512(0x11b));},0x1388);const _0x13daf6=_0x155c92=>{const _0x24c3bb=_0x22acb3;_0x13ee2d=!![],_0x1f9b63(_0x155c92[_0x24c3bb(0xf8)]);};GroupFileInfoUpdateTasks[_0x22acb3(0x100)](_0x563606[_0x22acb3(0xec)](randomUUID),_0x13daf6),await napCatCore[_0x22acb3(0x113)][_0x22acb3(0x114)]()[_0x22acb3(0xe6)](_0x4f3673,_0x4de54d);});}static async[_0x5ef461(0xfe)](_0x548925,_0x57b616,_0xa1324c){const _0x45f7c5=_0x5ef461;return napCatCore[_0x45f7c5(0x113)][_0x45f7c5(0xfd)]()['getMsgsIncludeSelf'](_0x548925,_0x57b616,_0xa1324c,!![]);}static async[_0x5ef461(0x10b)](){}static async[_0x5ef461(0x108)](_0x5e4501,_0xc49139){const _0x305251=_0x5ef461;await napCatCore[_0x305251(0x113)]['getMsgService']()[_0x305251(0x108)]({'chatType':_0x5e4501[_0x305251(0x104)],'peerUid':_0x5e4501[_0x305251(0x101)]},_0xc49139);}static async[_0x5ef461(0x102)](_0x1fa733,_0x1375ee,_0x4840f2=!![],_0x184e97=0x2710){const _0x2f6a12=_0x5ef461,_0x447cb6={'RicWG':function(_0x5c15e5,_0x3c4b1f){return _0x5c15e5>_0x3c4b1f;},'mDytH':'发送超时','aLPmy':function(_0x4696c2,_0x16844f){return _0x4696c2(_0x16844f);},'UvIyj':function(_0x38aa5f){return _0x38aa5f();},'UFcXt':function(_0x12cc76,_0x17f88d){return _0x12cc76===_0x17f88d;},'VlxqA':function(_0x417d4d,_0x69b4dd,_0x4407cc){return _0x417d4d(_0x69b4dd,_0x4407cc);}},_0x52a2d2=_0x1fa733[_0x2f6a12(0x101)];let _0x58f32c=0x0;const _0x30452a=async()=>{const _0x19c248=_0x2f6a12;if(_0x447cb6[_0x19c248(0xfc)](_0x58f32c,_0x184e97))throw _0x447cb6[_0x19c248(0xfa)];const _0x556291=sendMessagePool[_0x1fa733['peerUid']];if(_0x556291)return await _0x447cb6['aLPmy'](sleep,0x1f4),_0x58f32c+=0x1f4,await _0x447cb6['UvIyj'](_0x30452a);else return;};return await _0x30452a(),new Promise((_0x1dfbb2,_0x13d045)=>{const _0x4aa0ce=_0x2f6a12;let _0x2854f3=![],_0x2b7f05=null;const _0xe66d05=_0x447cb6[_0x4aa0ce(0xe1)](randomUUID);sendSuccessCBMap[_0xe66d05]=_0x4cf8c9=>{const _0x38dab8=_0x4aa0ce;if(_0x447cb6[_0x38dab8(0xe0)](_0x4cf8c9[_0x38dab8(0xeb)],_0x2b7f05?.[_0x38dab8(0xeb)])){if(_0x447cb6[_0x38dab8(0xe0)](_0x4cf8c9[_0x38dab8(0xf7)],0x2))return delete sendSuccessCBMap[_0xe66d05],_0x2854f3=!![],_0x447cb6[_0x38dab8(0xed)](_0x1dfbb2,_0x4cf8c9),!![];return![];}return![];},sendMessagePool[_0x52a2d2]=async _0x3316e4=>{delete sendMessagePool[_0x52a2d2],_0x2b7f05=_0x3316e4;},_0x447cb6[_0x4aa0ce(0x10e)](setTimeout,()=>{const _0x199adc=_0x4aa0ce;if(_0x2854f3)return;delete sendMessagePool[_0x52a2d2],delete sendSuccessCBMap[_0xe66d05],_0x447cb6[_0x199adc(0xed)](_0x13d045,'发送超时');},_0x184e97);const _0x3688dc=napCatCore['session'][_0x4aa0ce(0xfd)]()[_0x4aa0ce(0x102)]('0',_0x1fa733,_0x1375ee,new Map());});}static async['forwardMsg'](_0x16fea9,_0x135cb8,_0x4f4cc0){const _0x2b5702=_0x5ef461;return napCatCore['session'][_0x2b5702(0xfd)]()['forwardMsg'](_0x4f4cc0,_0x16fea9,[_0x135cb8],new Map());}static async[_0x5ef461(0xe3)](_0x393efa,_0x5da67d,_0x1d0f9f){const _0x38b3a9=_0x5ef461,_0x460b1a={'zGJmi':_0x38b3a9(0xe2),'mvGIQ':function(_0x48e1a1,_0x58f4c9){return _0x48e1a1==_0x58f4c9;},'egkiW':function(_0x4e0daa,_0x141416){return _0x4e0daa==_0x141416;},'BSBsH':function(_0x42a278,_0x2182a1){return _0x42a278(_0x2182a1);},'GKwHw':_0x38b3a9(0x118),'GVLOK':function(_0x5e8884){return _0x5e8884();},'XkSAz':function(_0x365839,_0x1ccb9a,_0x784239){return _0x365839(_0x1ccb9a,_0x784239);}},_0x2606d6=_0x1d0f9f[_0x38b3a9(0xf1)](_0x4cdf2e=>{return{'msgId':_0x4cdf2e,'senderShowName':selfInfo['nick']};});return new Promise((_0x21d093,_0xa09a90)=>{const _0x1ef2c9=_0x38b3a9;let _0x22260d=![];const _0x53d251=_0x1382fd=>{const _0x7f5c59=_0x1e1c,_0x1703fb=_0x1382fd[_0x7f5c59(0xdb)][_0x7f5c59(0xe7)](_0x188da2=>_0x188da2[_0x7f5c59(0xdc)]);if(!_0x1703fb)return;const _0x207aef=JSON[_0x7f5c59(0x105)](_0x1703fb[_0x7f5c59(0xdc)]['bytesData']);if(_0x207aef[_0x7f5c59(0xf9)]!=_0x460b1a['zGJmi'])return;_0x460b1a[_0x7f5c59(0x107)](_0x1382fd[_0x7f5c59(0x101)],_0x5da67d[_0x7f5c59(0x101)])&&_0x460b1a[_0x7f5c59(0xea)](_0x1382fd[_0x7f5c59(0x103)],selfInfo[_0x7f5c59(0x109)])&&(_0x22260d=!![],_0x21d093(_0x1382fd));};sentMsgTasks[_0x1ef2c9(0x100)](_0x460b1a[_0x1ef2c9(0xe8)](randomUUID),_0x53d251),_0x460b1a[_0x1ef2c9(0xf5)](setTimeout,()=>{const _0x4e9dcf=_0x1ef2c9;!_0x22260d&&_0x460b1a['BSBsH'](_0xa09a90,_0x460b1a[_0x4e9dcf(0x117)]);},0x1388),napCatCore[_0x1ef2c9(0x113)][_0x1ef2c9(0xfd)]()[_0x1ef2c9(0xe4)](_0x2606d6,_0x393efa,_0x5da67d,[],new Map());});}}