Skip to content

Commit

Permalink
Merge pull request #372 from XMOJ-Script-dev/boomzero/sync-inst-msg
Browse files Browse the repository at this point in the history
use the same peram (?to_user) as xmoj
  • Loading branch information
boomzero authored Jan 21, 2024
2 parents 942774a + 8b345f1 commit 5d4e1cd
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 30 additions & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,17 @@
"Prerelease": false,
"UpdateContents": [],
"Notes": "No release notes were provided for this release."
},
"1.1.19": {
"UpdateDate": 1705841193051,
"Prerelease": true,
"UpdateContents": [
{
"PR": 372,
"Description": "use the same peram (?to_user) as xmoj"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
14 changes: 7 additions & 7 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.1.18
// @version 1.1.19
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -946,7 +946,7 @@ else {
ToastViewButton.classList.add("btn", "btn-primary", "btn-sm");
ToastViewButton.innerText = "查看";
ToastViewButton.addEventListener("click", () => {
open("https://www.xmoj.tech/mail.php?other=" + MentionList[i].FromUserID, "_blank");
open("https://www.xmoj.tech/mail.php?to_user=" + MentionList[i].FromUserID, "_blank");
RequestAPI("ReadMailMention", {
"MentionID": Number(MentionList[i].MentionID)
}, () => { });
Expand Down Expand Up @@ -3568,7 +3568,7 @@ int main()
}
});
} else if (location.pathname == "/mail.php") {
if (SearchParams.get("other") == null) {
if (SearchParams.get("to_user") == null) {
document.querySelector("body > div > div.mt-3").innerHTML = `<div class="row g-2 align-items-center">
<div class="col-auto form-floating">
<input class="form-control" id="Username" placeholder=" " spellcheck="false" data-ms-editor="true">
Expand Down Expand Up @@ -3612,7 +3612,7 @@ int main()
let Row = document.createElement("tr"); ReceiveTable.children[1].appendChild(Row);
let UsernameCell = document.createElement("td"); Row.appendChild(UsernameCell);
let UsernameSpan = document.createElement("span"); UsernameCell.appendChild(UsernameSpan);
GetUsernameHTML(UsernameSpan, Data[i].OtherUser, false, "https://www.xmoj.tech/mail.php?other=");
GetUsernameHTML(UsernameSpan, Data[i].OtherUser, false, "https://www.xmoj.tech/mail.php?to_user=");
if (Data[i].UnreadCount != 0) {
let UnreadCountSpan = document.createElement("span"); UsernameCell.appendChild(UnreadCountSpan);
UnreadCountSpan.className = "ms-1 badge text-bg-danger";
Expand Down Expand Up @@ -3687,7 +3687,7 @@ int main()
</thead>
<tbody></tbody>
</table>`;
GetUsernameHTML(ToUser, SearchParams.get("other"));
GetUsernameHTML(ToUser, SearchParams.get("to_user"));
let RefreshMessage = (Silent = true) => {
if (!Silent) {
MessageTable.children[1].innerHTML = "";
Expand All @@ -3700,7 +3700,7 @@ int main()
}
}
RequestAPI("GetMail", {
"OtherUser": String(SearchParams.get("other"))
"OtherUser": String(SearchParams.get("to_user"))
}, async (ResponseData) => {
if (ResponseData.Success) {
ErrorElement.style.display = "none";
Expand Down Expand Up @@ -3744,7 +3744,7 @@ int main()
Send.children[0].style.display = "";
let ContentData = Content.value;
RequestAPI("SendMail", {
"ToUser": String(SearchParams.get("other")),
"ToUser": String(SearchParams.get("to_user")),
"Content": String(ContentData)
}, (ResponseData) => {
Send.disabled = false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
"version": "1.1.18",
"version": "1.1.19",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down

0 comments on commit 5d4e1cd

Please sign in to comment.