remove snowflake instances

This commit is contained in:
MathMan05 2024-09-03 11:00:44 -05:00
parent 004beb4955
commit e66b6c0883
16 changed files with 97 additions and 149 deletions

View file

@ -3,10 +3,9 @@ import { Member } from "./member.js";
import { MarkDown } from "./markdown.js";
import { Contextmenu } from "./contextmenu.js";
import { SnowFlake } from "./snowflake.js";
class User {
class User extends SnowFlake {
owner;
hypotheticalpfp;
snowflake;
avatar;
username;
nickname = null;
@ -62,9 +61,6 @@ class User {
return "offline";
}
}
get id() {
return this.snowflake.id;
}
static contextmenu = new Contextmenu("User Menu");
static setUpContextMenu() {
this.contextmenu.addbutton("Copy user id", function () {
@ -141,6 +137,7 @@ class User {
return this.owner;
}
constructor(userjson, owner, dontclone = false) {
super(userjson.id);
this.owner = owner;
if (!owner) {
console.error("missing localuser");
@ -152,7 +149,6 @@ class User {
continue;
}
if (thing === "id") {
this.snowflake = new SnowFlake(userjson[thing]);
continue;
}
this[thing] = userjson[thing];