replying fixes

This commit is contained in:
MathMan05 2025-04-06 22:10:42 -05:00
parent 3686f24ca0
commit d5b860b34e
3 changed files with 6 additions and 2 deletions

View file

@ -1458,7 +1458,7 @@ class Channel extends SnowFlake {
this.fakeMessageMap.delete(id);
}
makeFakeMessage(content: string, files: filejson[] = []) {
makeFakeMessage(content: string, files: filejson[] = [], reply = undefined) {
const m = new Message(
{
author: this.localuser.user.tojson(),
@ -1478,6 +1478,7 @@ class Channel extends SnowFlake {
nonce: Math.random() + "",
type: 0,
pinned: false,
message_reference: reply,
},
this,
true,
@ -1602,7 +1603,7 @@ class Channel extends SnowFlake {
res.open("POST", this.info.api + "/channels/" + this.id + "/messages");
res.setRequestHeader("Content-type", (ctype = this.headers["Content-type"]));
res.setRequestHeader("Authorization", this.headers.Authorization);
funcs = this.makeFakeMessage(content);
funcs = this.makeFakeMessage(content, [], body.message_reference);
res.send((rbody = JSON.stringify(body)));
/*
res = fetch(this.info.api + "/channels/" + this.id + "/messages", {
@ -1643,6 +1644,7 @@ class Channel extends SnowFlake {
size: _.size,
url: URL.createObjectURL(_),
})),
body.message_reference,
);
res.send((rbody = formData));
/*

View file

@ -350,6 +350,7 @@ type messagejson = {
pinned: boolean;
type: number;
webhook?: webhookInfo;
message_reference?: string;
};
type filejson = {
id: string;

View file

@ -1133,6 +1133,7 @@ span.instanceStatus {
align-items: center;
justify-content: space-between;
transition: height 0.2s;
flex-shrink: 0;
}
.cancelReply {
height: 16px;