Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

兼容新版QQ 9.9.8 的api #51

Merged
merged 3 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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