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

View file

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

View file

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