mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-10-23 06:22:21 +00:00
some changes
This commit is contained in:
1 parent
d5c37afed3
commit
b510bcac8b
5 files changed
+25
-3
No files matched your search
@@ -429,7 +429,7 @@ stickerTB.onclick = (e) => {
|
||||
};
|
||||
const updateIcon = document.getElementById("updateIcon");
|
||||
if (updateIcon) {
|
||||
new Hover(() => updateIcon.textContent).addEvent(updateIcon);
|
||||
new Hover(() => updateIcon.textContent || "").addEvent(updateIcon);
|
||||
updateIcon.onclick = () => {
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
@@ -44,6 +44,7 @@ interface readyjson {
|
||||
timezone_offset: number;
|
||||
view_nsfw_guilds: boolean;
|
||||
};
|
||||
auth_token?: string;
|
||||
guilds: guildjson[];
|
||||
relationships: {
|
||||
id: string;
|
||||
|
||||
@@ -56,7 +56,9 @@ class Localuser {
|
||||
][],
|
||||
);
|
||||
lastSequence: number | null = null;
|
||||
token!: string;
|
||||
get token() {
|
||||
return this.headers.Authorization;
|
||||
}
|
||||
userinfo!: Specialuser;
|
||||
serverurls!: Specialuser["serverurls"];
|
||||
initialized!: boolean;
|
||||
@@ -212,7 +214,6 @@ class Localuser {
|
||||
this.rights = new Rights("");
|
||||
return;
|
||||
}
|
||||
this.token = userinfo.token;
|
||||
this.userinfo = userinfo;
|
||||
this.perminfo.guilds ??= {};
|
||||
this.perminfo.user ??= {};
|
||||
@@ -348,6 +349,12 @@ class Localuser {
|
||||
this.userinfo.id = this.user.id;
|
||||
this.userinfo.pfpsrc = this.user.getpfpsrc();
|
||||
|
||||
if (ready.d.auth_token) {
|
||||
this.userinfo.token = ready.d.auth_token;
|
||||
this.headers.Authorization = ready.d.auth_token;
|
||||
this.userinfo.updateLocal();
|
||||
}
|
||||
|
||||
this.status = this.ready.d.user_settings.status;
|
||||
this.channelfocus = undefined;
|
||||
this.lookingguild = undefined;
|
||||
|
||||
@@ -510,14 +510,27 @@ class User extends SnowFlake {
|
||||
this.contextmenu.addButton(
|
||||
() => I18n.user.instanceBan(),
|
||||
function (this: User) {
|
||||
const params = {
|
||||
reason: "",
|
||||
persistInstanceBan: true,
|
||||
};
|
||||
const menu = new Dialog("");
|
||||
const options = menu.float.options;
|
||||
options.addTitle(I18n.user.confirmInstBan(this.name));
|
||||
options.addTextInput(I18n.member["reason:"](), () => {}, {}).onchange = (txt) => {
|
||||
params.reason = txt;
|
||||
};
|
||||
options.addCheckboxInput(I18n.member.persist(), () => {}, {
|
||||
initState: false,
|
||||
}).onchange = (checked) => {
|
||||
params.persistInstanceBan = !checked;
|
||||
};
|
||||
const opt = options.addOptions("", {ltr: true});
|
||||
opt.addButtonInput("", I18n.yes(), () => {
|
||||
fetch(this.info.api + "/users/" + this.id + "/delete", {
|
||||
headers: this.localuser.headers,
|
||||
method: "POST",
|
||||
body: JSON.stringify(params),
|
||||
});
|
||||
menu.hide();
|
||||
});
|
||||
|
||||
@@ -734,6 +734,7 @@
|
||||
"kick": "Kick $1 from $2",
|
||||
"timeout":"Timeout $1",
|
||||
"reason:": "Reason:",
|
||||
"persist":"Only delete user:",
|
||||
"timeoutTime":"Timeout Time:",
|
||||
"ban": "Ban $1 from $2",
|
||||
"nick:": "Nickname:"
|
||||
|
||||
Reference in new issue
Block a user