Skip to content

Commit

Permalink
Merge pull request #51 from CreepingG/master
Browse files Browse the repository at this point in the history
兼容新版QQ 9.9.8 的api(还须完善)
  • Loading branch information
xh321 authored Mar 23, 2024
2 parents a54a6de + 6a578b3 commit e487e7f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ function onBrowserWindowCreated(window) {
//拦截撤回IPC
if (
args1.cmdName != null &&
args1.cmdName.indexOf("onMsgInfoListUpdate") != -1 &&
(args1.cmdName.indexOf("onMsgInfoListUpdate") != -1 ||
args1.cmdName.indexOf("onActiveMsgInfoUpdate") != -1) &&
args1.payload != null &&
args1.payload.msgList instanceof Array &&
args1.payload.msgList[0].msgType == 5 &&
Expand Down Expand Up @@ -610,7 +611,8 @@ function onBrowserWindowCreated(window) {
else if (
(args1.cmdName != null &&
args1.payload != null &&
args1.cmdName.indexOf("onRecvMsg") != -1 &&
(args1.cmdName.indexOf("onRecvMsg") != -1 ||
args1.cmdName.indexOf("onRecvActiveMsg") != -1) &&
args1.payload.msgList instanceof Array) ||
(args1.cmdName.indexOf("onAddSendMsg") != -1 &&
args1.payload.msgRecord != null) ||
Expand Down
7 changes: 7 additions & 0 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ async function onLoad() {
if (arkElement.classList.contains("gray-tip-message")) return;
arkElement.classList.add("recalledNoMargin");
await appendRecalledTag(arkElement.parentElement);
} else{
var container = document.querySelector(`.ml-item[id='${msgId}'] .msg-content-container`);
if (container) await appendRecalledTag(container);
}
});
//消息列表更新回调
Expand Down Expand Up @@ -637,6 +640,10 @@ async function onLoad() {
arkElement.classList.add("recalledNoMargin");
await appendRecalledTag(arkElement.parentElement);
}
else{
var container = el.querySelector('.msg-content-container');
if (container) await appendRecalledTag(container);
}
} catch (e) {
console.log("[Anti-Recall]", "反撤回消息时出错", e);
}
Expand Down

0 comments on commit e487e7f

Please sign in to comment.