Skip to content

Commit

Permalink
fix wrong message with previous reply
Browse files Browse the repository at this point in the history
  • Loading branch information
juvian committed Jul 13, 2024
1 parent 40be226 commit 88fde03
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
Binary file modified NeoChat.zip
Binary file not shown.
5 changes: 5 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ function processMessage (request, sender, sendResponse) {

if (from.name == null) from.name = request.name;
if (from.image == null) from.image = request.image;

//fix wrong text saved by show reply fix tnt did on July 10th
if (from.messages[request.messageID].text != request.message.text && request.message.date >= new Date("2024-07-06T00:00:00") && request.message.date <= new Date("2024-09-06T00:00:00")) {
from.messages[request.messageID].text = request.message.text;
}

from.name = from.name.trim().toLowerCase()

Expand Down
7 changes: 7 additions & 0 deletions changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,12 @@
"data": [
"Fix sending emails from neochat"
]
},
{
"version": "1.2.9",
"date": "12/7/2024",
"data": [
"Fix the wrong message being saved caused by tnt fixing the show your previous message"
]
}
]
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"manifest_version": 2,

"short_name": "Neopets Chat",
"name" : "Neopets mail enchancer",
"name" : "Neopets mail enhancer",
"description": "This extension improves neopets inbox and view/reply messages",
"version": "1.2.7",
"version": "1.2.9",
"content_scripts": [
{
"matches": ["*://www.neopets.com/neomessages.phtml?type=read_message&folder=Inbox&id=*"],
Expand Down
5 changes: 2 additions & 3 deletions viewChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,14 @@ function selectUser (li) {
form.find(".message_body").val(message)
form.find(".subject").val(subject)
form.find(".recipient").val(username)

$.post("//www.neopets.com/process_neomessages.phtml", new URLSearchParams(new FormData(form.get(0))).toString()).success(function(html){
fetch(window.location.protocol+'//www.neopets.com/process_neomessages.phtml', {method: 'POST', body: new URLSearchParams(new FormData(form.get(0)))}).then(r => r.text()).then(html => {
if ($(html).find(".errormess").length) {
makeToast("error", null, $(html).find(".errormess .errormess .errormess").html().split("<br>")[0]);
ui.find(".write-message textarea").val(message)
} else {
makeToast('success', null, "Message sent");
}
}).error(function () {
}).catch(function () {
makeToast('error', null, "Network error, try again later");
ui.find(".write-message textarea").val(message);
})
Expand Down
2 changes: 1 addition & 1 deletion viewMail.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var message = {
subject : table.find("tr:eq(3) td:eq(1)").text()
}

setData(table.find("tr:eq(4) td:eq(1)"), message);
setData(table.find("tr:last-child td:eq(1)"), message);



Expand Down

0 comments on commit 88fde03

Please sign in to comment.